What is Cache-Control?
Also called: Browser caching, ETag
Cache-Control is a response header from your server. It says whether and how long a browser or crawler may reuse a stored copy of the page. ETag and Last-Modified let them ask if the copy is still current.
Why it matters
With caching, return visits load faster and bots use less bandwidth. A wrong setting can also show stale pages, so choose a short lifetime for pages that change often.
How Onbiom checks it
"Return visits load fast" looks at the homepage response headers. It passes when any of Cache-Control, Expires, ETag or Last-Modified is present, and fails when none is. Onbiom does not judge the length of the lifetime and does not measure compression, because it asks for an uncompressed copy.
In your report this appears as: Cache headers on the homepage.
How to check it yourself
- Run the command below and look for Cache-Control or ETag in the answer.
curl -sI https://example.com/ | grep -i -E 'cache-control|etag|expires|last-modified'Not sure about your own site? Paste your address and see in a minute which of these checks your site passes. Free, no account needed.
How to fix it
- Cloudflare
- In the dashboard open Caching, then Configuration, and set a browser cache lifetime.
- nginx
- Add an expires or add_header Cache-Control line for your pages.
- Apache
- Use mod_expires or the Header directive to set Cache-Control.
- Ask your web person
- A caching plugin usually sets these headers for you.
Related terms
Sources and further reading
Last reviewed: