This is an old revision of the document!
Server Push supported on LiteSpeed Web Server
Server Push is a method of information delivery where a server pushes a resource directly to the client without first receiving a request to do so. By doing this the server can attempt to anticipate client requests and pre-push them into the client’s cache in an effort to avoid the usual request-response round trip delay.
Requirements
- LiteSpeed Enterprise 5.2+
- Site use HTTPS
- Browser support HTTP/2
Verification
We are going to introduce how to verify Server Push with WordPress+LScache Site then with CloudClare. If you want to try server push and file making by yourself, please refer Server Push.
Install WordPress and LSCache
Verify browser support HTTP/2
Configure LSCache to use Server Push
- Navigate to WordPress Control Panel>LSCache>Settings>Optimize tab
- Set
CSS HTTP/2 Push
andJS HTTP/2 Push
as On
Verify Server Push
We are going to use Chrome developer tool as our verification tool.
Configure CDN to serve with Server Push
Why we verify with CloudFlare? Cloudflare supports HTTP/2 Server Push with the Link header field on all plan levels. Cloudflare will look for the Link header field, in response headers from the origin server and extract URI-references with parameters rel=preload
. These URI will be pushed to the client.
Follow this LiteSpeed blog to Setup CDN from LSCache
Other method to verify
- Enter browser with chrome://net-internals/#http2
- Refresh your test site
- Click hyperlink of ID
- Check HTTP2_SESSION_RECV_HEADERS>link, which will contain like this
rel=preload; as=style,</wordpress/wp-content/plugins/litespeed-cache/css/litespeed.css>; rel=preload; as=style,</wordpress/wp-includes/js/admin-bar.min.js>;