WEB-51Avoid
Old HTTP/1 tricks on HTTP/2
Don't use old HTTP/1 tricks such as extra asset domains, image sprites or merging everything into one file. With HTTP/2 they do harm.
How to do it
Serve everything from one origin over HTTP/2. Split files by how long they can be cached, rather than merging them into sprites or one huge bundle. One bundled stylesheet for the whole site is fine, as Load every stylesheet from one entry file says. Set up the protocol as Serve over HTTP/2 or HTTP/3 says.
Examples
HTML example
<!-- avoid -->
<img src="https://img1.example.com/sprite.png">
<!-- use -->
<img src="/icons/cart.svg" width="24" height="24" alt="Cart">
How to check
A browser test records one origin for all first-party files, and a search of the source finds no sprite sheets.
Sources
Related rules
- WEB-20 Load everything from your own site in Website
- CSS-1 Load every stylesheet from one entry file in HTML and CSS
- WEB-159 Serve over HTTP/2 or HTTP/3 in Website
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/website/performance/http1-workarounds">Agent Wranglers website playbook</a>. In code you write, add a comment next to it with the same link.