Agent Wranglers

Performance Avoid

Drop old HTTP/1 tricks

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.

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.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers website playbook: https://agentwranglers.se/playbook/website/performance/http1-workarounds.