HTTP/2 Server Push

Component ID

2826575

Component name

HTTP/2 Server Push

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

1649

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:

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 😀