2017 © Pedro PelĂĄez
 

library pusher

image

mako/pusher

  • Thursday, May 3, 2018
  • by freost
  • Repository
  • 1 Watchers
  • 1 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Mako Pusher

Build Status, (*1)

Pusher enables you to easily implement preloading, prefetching, prerendering, dns-prefetching and preconnecting in your applications., (*2)

Requirements

Mako 8.0 or greater., (*3)

Usage

If you're using the PusherMiddleware then you can access the pusher instance using the Request::getAttribute() method., (*4)

$pusher = $this->request->getAttribute('mako.pusher');

You can tell the client to preload your assets., (*5)

$pusher->push('/assets/css/style.css', ['preload']);

// You can also use the "preload" convenience method

$pusher->preload('/assets/css/style.css');

Preloading requires a HTTP2 server with push support (e.g. Apache 2.4.24+)., (*6)

You can tell the browser to prefetch resources that you think the user will need next., (*7)

$pusher->push('https://example.org/image.jpg', ['prefetch', 'as' => 'image']);

// You can also use the "prefetch" convenience method

$pusher->prefetch('https://example.org/image.jpg', ['as' => 'image']);

You can tell the browser to prefetch and render resources that you think the user will visit next., (*8)

$pusher->push('https://example.org/next', ['prerender']);

// You can also use the "prerender" convenience method

$pusher->prerender('https://example.org/next');

You can resolve the DNS lookup for a domain that you know your client will have to connect to when fetching resources., (*9)

$pusher->push('https://fonts.gstatic.com', ['dns-prefetch']);

// You can also use the "dnsPrefetch" convenience method

$pusher->dnsPrefetch('https://fonts.gstatic.com');

You can pre-connect to a domain that you know your client will have to connect to when fetching resources. This will resolve the DNS lookup but it also includes the TCP handshake, and optional TLS negotiation., (*10)

$pusher->push('https://fonts.gstatic.com', ['preconnect', 'crossorigin' => true]);

// You can also use the "preconnect" convenience method

$pusher->preconnect('https://fonts.gstatic.com', ['crossorigin' => true]);

More details

The Versions

03/05 2018

dev-master

9999999-dev http://makoframework.com

  Sources   Download

BSD-3-Clause

The Requires

  • php >=7.0.0

 

The Development Requires

by Frederic G. Østby

framework mako http2

02/03 2018

1.0.0

1.0.0.0 http://makoframework.com

  Sources   Download

BSD-3-Clause

The Requires

  • php >=7.0.0

 

The Development Requires

by Frederic G. Østby

framework mako http2