Link:<...> rel="prefetch"
header for every enqueued script and style as WordPress outputs them into the page source. Unfortunately, it can't help plugins and themes that output their scripts directly into the page itself, but these will continue to work as they always have.
Requires a web server that supports HTTP/2.
Server push is triggered by the same mechanism as link prefetching, which almost all major modern browsers support over HTTP 1.x. So even if you can't take advantage of HTTP/2's features, people visiting your site may still get a better experience from prefetching.
There are a couple ways:
nghttp -v http://example.com
will show all the HTTP/2 signalling packets, HTTP headers, content, and resources sent from the server in a single request. You can see PUSH PROMISE
signals from the server and the pushed resources after the main page is sent.PUSH PROMISE
packets and the pushed resources.The source code is available at https://github.com/daveross/http2-server-push. Issues and pull requests are welcome and encouraged!