What does it do?
HTTP/2 Server push allows you to push assets to the client or browser (User) in advance (before the user requests these assets) and by doing so, reduce latency.
When enabled, the CDN will look for the HTTP/2 server push header (usually the Link header) and will push the assets that are defined in this header to the user in advance, from cache.
If the file is not already in cache, it will be fetched from the origin.
What does this header look like?
A Link header for an asset to be pushed would look something like this:
Link: "<https://example.com/css/styles.css; rel=preload; as=style"
It is important to note, that while the rel=preload
section of the header is required, the as=
can be changed to correspond to the file type and use-case.
When and how should I use it?
You should use this if you are using, or would like to start using HTTP/2 Server Push on your website, and would like files being pushed to be served from your CDN cache.
Example:
If, for example, you are using the Link
header to pre-load a CSS file along with your site's HTML, you might be sending a Link
header that looks something like this, with your index.html
file:
Link: "<https://example.com/css/styles.css; rel=preload; as=style"
To have this file served from cache, select Edit, enter that header value into the Link Header field and select Save.
Now, any time the CDN detects the Link: "<https://example.com/css/styles.css; rel=preload; as=style"
response header when delivering a file, it will attempt to load that styles.css
file from cache via HTTP/2 Server Push.
For more information on this feature, please feel free to check out this article in our Help Center.