HTTP/2 Server Push
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Downloads
Component created
Component changed
Component body
HTTP/2 Server Push for Drupal 8. All CSS & JS assets automatically use Server Push.
Install it and it works. There's no configuration, no UI.
Supported on the following CDNs (as of April 2017):
- Fastly
- CloudFlare
- EdgeCast
What’s the benefit of Server Push?
When a browser requests a page, the server sends the HTML in the response, and then needs to wait for the browser to parse the HTML and issue requests for all of the embedded assets before it can start sending the JavaScript, images and CSS.
Server Push potentially allows the server to avoid this round trip of delay by “pushing†the responses it thinks the client will need into its cache.
Related reading:
- https://http2.github.io/faq/#whats-the-benefit-of-server-push
- https://hpbn.co/http2/#server-push
- https://blog.cloudflare.com/announcing-support-for-http-2-server-push-2/
- https://www.igvita.com/2013/06/12/innovating-with-http-2.0-server-push/
- https://docs.google.com/document/d/1K0NykTXBbbbTlv60t5MyJvXjqKGsCVNYHyLE...
Caveats
HTTP/2 Server Push really isn't ready for prime time. Pushing happens on all page loads, because of the broken current infrastructure, both in the spec and in browsers. The solution (cache digests) is a work in progress. Today, clients can already abort pushed assets that they already have, but it's very broken.
Push isn't ready for prime time yet, but if you do want to experiment, this module will help you do it!
Drupal 7
The Advanced CSS/JS Aggregation module for Drupal 7 is how you can get HTTP/2 Server Push support in Drupal 7. It requires some fairly complex configuration to set up though. Another reason to migrate to Drupal 8 😀
