17. About HTTP/2 Push¶
This document contains technical details about our HTTP/2 implementation, for a hands-on
introduction on how to enable HTTP/2 push in sc_pack
deployments,
check our guide on HTTP/2 push.
17.1. Priorities on pushed streams¶
HTTP/2 uses independent streams to exchange resources between the browser and the server. Those assets however share the same channel, and their relative priority can heavily influence how quickly a web-page is rendered.
With ShimmerCat, streams are pushed by default with conventional priorities: CSS high, JS a little less high, and so on. The main response HTML is given the highest priority and its DATA frames will start traveling the HTTP/2 connection as soon as they are available.
17.2. How is it configured: push-lists and calm maps¶
HTTP/2 Push is optimized by the accelerator service, and the output of the accelerator service is what we call “push lists”: a list of resources to push. These are YAML files with the relative locations of the assets to push for a given view.
They live in a file with .push-list
extension that looks like this one:
hints:
- /my-statics-location/my-js/cool.js
- /my-statics-location/my-css/coolest.css?ver=1.2
# ...
schema: push-list-v1
In the example above, ShimmerCat will push the files with URL paths
/my-statics-location/my-js/cool.js
and /my-statics-location/my-css/coolest.css
,
though for the later it will also use the provided query string.
The .push-list
files are not limited to pushed assets, but can also contain so
called calm maps.
17.3. Works for all browsers¶
ShimmerCat QS
HTTP/2 Push implementation is guided by the principle “it should work today”.
Since browser’s HTTP/2 Push implementations are slightly different, ShimmerCat comes with
a (so far very small) database of adaptations for HTTP/2 Push, even disabling it for those
cases where the technique is of no use.
The adaptations used as of QS 2378 are as follow:
Modern Safari versions, in Mac and iOS: disable HTTP/2 Push, since despite our extensive years of testing, we have never seen Safari use any pushed assets, although we have seen it crash plenty of times when deploying HTTP/2 Push, always using the same cryptic error message that Safari uses for all network and miscellaneous errors.
Microsoft Edge: limit the number of concurrently pushed streams to 8.
Firefox in Android: limit the number of concurrently pushed streams to 16.
Browsers are identified using fingerprints for their TLS and HTTP/2 stacks, so changing
the “User-Agent” in the HTTP request has no effect on the decision about enabling
HTTP/2 push that ShimmerCat QS
takes.