Download the PHP package wearerequired/h2push without Composer
On this page you can find all versions of the php package wearerequired/h2push. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wearerequired/h2push
More information about wearerequired/h2push
Files in wearerequired/h2push
Package h2push
Short Description Sends Link headers to bring HTTP/2 Server Push for scripts and styles to WordPress.
License GPL-2.0-or-later
Homepage https://github.com/wearerequired/h2push
Informations about the package h2push
HTTP/2 Server Push
Sends Link headers to bring HTTP/2 Server Push for scripts and styles to WordPress. Falls back to <link>
element if headers are already sent.
Provides filters to customize and extend the resources to push.
Installation
Install the latest version with
The plugin requires at least PHP 7.4 and WordPress 5.6.
Hooks reference
h2push.as_header
By default the plugin will use the Link header if no headers are sent yet and falls back to the <link>
element. To change this behavior you can use the h2push.as_header
filter. Example:
This filter is also useful if the server doesn't support HTTP/2 yet and you still want to benefit from preloading.
h2push.push_resources
By default the plugin collects all enqueued scripts and styles which are have been registered before or at the wp_enqueue_scripts
hook. The h2push.push_resources
filters allows to customize the list of resources. Example:
h2push.is_allowed_push_host
By default the plugin only sends push requests for local resources where the asset URL matches the home URL. To change this behavior you can use the h2push.is_allowed_push_host
filter. Example: