Configuration for HTTP/2
If your site runs on HTTP/2, here are the things you should consider for WP Rocket.
Not sure if your site uses HTTP/2? Check with this simple tool:
⚡️ HTTP/2 test by KeyCDN
To combine, or not to combine?
While concatenation (i.e. combining JS into fewer files) is considered a best practice under HTTP/1, that’s not necessarily the case with HTTP/2.
There is ongoing debate as to whether some concatenation, i.e. combining files into small groups is beneficial. The real answer is that it may vary from site to site. We tend to think that concatenation won’t be as of much benefit on HTTP/2, but you should test the load time of your site with and without this option since results can vary.
WP Rocket reminds you to not activate file concatenation if your site runs on HTTP/2:
If your server uses HTTP/1, it’s worth to give it a try. Keep in mind, though, that this setting doesn’t work with all plugins or themes!
PageSpeed Insights, Pingdom Tools, or GTmetrix still saying you should combine CSS/JS files?
Most of the speed testing tools don’t yet adjust their recommendations or performance grade based on detection of HTTP/1 or HTTP/2. So you should always base your configuration on load time, not performance grade.
Domain Sharding
Domain sharding (nope, not a typo) is the practice of dividing up assets to be served from a few subdomains, and it is no longer a best practice with HTTP/2. If you’d like to read more about it, there’s an article on our blog:
What Is the Difference between a CDN and Domain Sharding?
What about CDNs?
A CDN can also perform domain sharding, so you may be wondering if you still need your CDN? The answer is “yes”!
The benefit of a CDN in serving assets from geographic locations closest to your visitors is still relevant in an HTTP/2 world. But there’s no need to create several subdomains to serve them from and the DNS lookup time required for each one will detract from performance.
References
- The Right Way to Bundle Your Assets for Faster Sites over HTTP/2 (Max Jung)
- Performance Best Practices in the HTTP/2 Era (Delicious Brains)
- Performance optimization in an HTTP/2 world (Yoast)