Cache-Control headers tell browsers and networks how long they may reuse a file instead of fetching it again. Used well, they make repeat visits faster. Used badly, they show visitors outdated pages. They are not a ranking factor, but they support site speed, which matters for visitors and for the experience metrics search engines look at.
The main headers
- Cache-Control: sets how long a response may be reused, for example max-age.
- ETag and Last-Modified: let a browser ask whether a file has changed, so the server can reply that nothing is new.
Static files
Images, scripts and style sheets with versioned names can be cached for a long time, because a new version gets a new file name. This saves repeat downloads and speeds up pages.
Rather have an expert do this for you?
Hand it over and get back to running your business.
HTML pages
Pages change more often, so use short cache times or require the browser to check for updates. A long cache on HTML can leave visitors seeing yesterday’s content.
Mistakes to avoid
- Long caching on pages that change frequently.
- Caching error pages by accident.
- No cache headers at all on large static files.
- Different settings from a plugin, server and CDN that conflict.
How to check your headers
Use my HTTP header checker on a page and on one of its images, then compare the cache lines. Check speed results with the PageSpeed checker.
Where caching fits in speed work
Caching works alongside hosting and a CDN, as covered in hosting, caching and CDN for speed.
Frequently asked questions
Will caching hurt my rankings?
No, but a stale page seen by visitors can hurt trust.
Should I cache everything?
Cache static files aggressively and pages carefully.
Next steps
For a speed review, contact me here.
More in this series (HTTP header questions): start with Free HTTP Header Checker, then explore:
Request received
Thank you! Saad will contact you within the next 24 hours.
Keep an eye on your phone and inbox.
