The Cache-Control header is the HTTP response header that tells browsers and CDNs whether they may store a file and for how long, for example Cache-Control: public, max-age=31536000 (reuse it without checking for a year). To check it, run curl -sS -o /dev/null -D - https://yoursite.com/ | grep -i cache-control on Mac, Linux or Git Bash. In Windows PowerShell, type curl.exe -sS -o NUL -D - https://yoursite.com/ | findstr /i cache-control. No output means that response has no Cache-Control. Use the final https:// address: my http:// request to this site got a 301 redirect with no Cache-Control.
Below: what each directive means, real headers from this site and four well-known sites (26 November 2026), what to set, and why changes sometimes don’t show.

Key takeaways
no-cachemeans “check before reusing”, not “don’t cache”.no-storemeans don’t keep a copy.- Versioned CSS, JS and images can be cached for a year; HTML usually needs
no-cacheor a short lifetime. - This site’s HTML had no Cache-Control; its JS, CSS and images got
public, max-age=31557600(365.25 days). - Check with a GET, not only
curl -I: Cloudflare’s homepage answered HEAD and GET differently. - Lighthouse’s “Serve static assets with an efficient cache policy” is now the “Use efficient cache lifetimes” insight.
Table of Contents
- 1What the Cache-Control Header Does
- 2Real Cache-Control Headers From Five Sites
- 3How to Check Cache-Control
- 1. Chrome DevTools
- 2. curl on Mac, Linux or Git Bash
- 3. Windows PowerShell
- 4. Read the CDN and page-cache headers too
- 5. Lighthouse
- 4What Values to Use
- 5How to Set It on Your Platform
- 6Why Your Changes Don’t Show
- 7Does Cache-Control Help Speed and SEO?
- 8Mistakes to Avoid
- What does Cache-Control max-age mean?
- What is the difference between no-cache and no-store?
- What is s-maxage in Cache-Control?
- How do I check the Cache-Control header of a website?
- How do I fix “Use efficient cache lifetimes” in Lighthouse?
- Should HTML pages have a long Cache-Control max-age?
What the Cache-Control Header Does
MDN calls the browser’s own store a “private cache” and a cache in between, such as a proxy or CDN, a “shared cache”. Cache-Control speaks to both. RFC 9111 (June 2022) defines the directives; RFC 5861 adds stale-while-revalidate and RFC 8246 adds immutable.
| Directive | What it means |
|---|---|
| max-age=N | Fresh for N seconds, counted from when the origin generated it (MDN). |
| s-maxage=N | Like max-age, but only for shared caches (CDNs, proxies). |
| no-cache | May be stored, but must be checked with the server before each reuse. |
| no-store | Must not be stored by any cache. |
| public | Any cache may store it, even where it would otherwise be blocked. |
| private | Only the browser may store it. For logged-in or personal pages. |
| must-revalidate | Once stale, must be checked with the server before reuse. |
| immutable | Won’t change while fresh, so don’t re-check it on a normal reload. |
| stale-while-revalidate=N | Once stale, may be served for N more seconds while a fresh copy is fetched in the background. |
Expires gives a date after which the copy is stale, but RFC 9111 says that with max-age present “a recipient MUST ignore the Expires header field”. Age is a cache’s estimate, in seconds, of how long ago the origin generated or last validated the response. So max-age=3600 with Age: 3148 leaves 452 seconds of freshness (MDN’s homepage, HEAD).
MDN’s compatibility data lists stale-while-revalidate in Chrome 75, Firefox 68 and Safari 14, and immutable in Firefox 49 and Safari 11 but not Chrome. Browsers that don’t know a directive should ignore it.

Real Cache-Control Headers From Five Sites
On 26 November 2026 (13:27-13:35 UTC) I requested each homepage plus a static file found in its HTML, with curl’s default user agent from my Windows 11 PC in India, as both HEAD (curl -I) and GET.
| Response | Cache-Control (GET) | Other cache headers |
|---|---|---|
| harshilbarot.com homepage and an article | none | ETag, x-litespeed-cache, x-hcdn-cache-status |
| harshilbarot.com JS, CSS and logo WebP | public, max-age=31557600 | Expires one year and 6 hours later |
| wordpress.org homepage | none | none |
| wordpress.org JS and PNG | max-age=315360000 (10 years) | Expires 31 Dec 2037: nginx’s expires max pattern |
| www.cloudflare.com homepage | max-age=10 | CF-Cache-Status: HIT; HEAD got no-store instead |
| www.cloudflare.com CSS | max-age=31536000 | HEAD got public, max-age=31536000, immutable |
| github.com homepage | max-age=0, private, must-revalidate | ETag |
| GitHub asset CSS | public, max-age=31536000, immutable | X-Cache: HIT, HIT; Age 622063 |
| developer.mozilla.org homepage | public, max-age=3600 | Age 3149; Expires already in the past |
| MDN CSS | public, max-age=31536000 | Age 1580; Expires already in the past |

- This site’s HTML sends no Cache-Control, only an ETag and the LiteSpeed and Hostinger CDN status headers (wordpress.org’s homepage sent none either). With no lifetime given, RFC 9111 lets a cache use a heuristic, with no fixed algorithm.
- 31557600 is not a typo. It is 365.25 days, the Browser Cache TTL that LiteSpeed’s docs recommend for the LiteSpeed Cache plugin; I didn’t confirm which layer adds it here. Lighthouse’s example is 31536000 (365 days).
- HEAD and GET can disagree. Cloudflare’s homepage answered HEAD with
no-storein both runs and GET withmax-age=10in all five GET checks; its CSS lostpublicandimmutableon GET. So check with a GET. - An old Expires doesn’t matter when max-age is set. MDN’s homepage sent an Expires time over 11 hours in the past, plus
max-age=3600, which wins.
How to Check Cache-Control
1. Chrome DevTools
- Press F12 (Cmd+Option+I on Mac), open Network, reload.
- Click the page or a CSS, JS or image request, open Headers and read
cache-control,expires,ageand any CDN status header. - Reload with Disable cache unticked: the Size column shows which files came from the browser’s cache.
2. curl on Mac, Linux or Git Bash
curl -sS -o /dev/null -D - https://yoursite.com/ | grep -iE "^(cache-control|expires|age|cf-cache-status|x-litespeed-cache|x-hcdn-cache-status):"This sends a GET, discards the body and prints the cache headers; -S keeps errors visible. Run it on the page and on one CSS, JS and image URL from your page source. Keep the ^ anchors: in my unanchored test (findstr), age: matched GitHub’s content-language line and expires its Set-Cookie lines; an unanchored grep would match them too.
3. Windows PowerShell
curl.exe -sS -o NUL -D - https://yoursite.com/ | findstr /i /r "^cache-control: ^expires: ^age: ^cf-cache-status: ^x-litespeed-cache: ^x-hcdn-cache-status:"Type curl.exe, not curl: in Windows PowerShell 5.1, curl is an alias for Invoke-WebRequest. (More on reading headers: checking status codes and headers.)
4. Read the CDN and page-cache headers too
Status headers show what a cache actually did. Cloudflare defines cf-cache-status: HIT as “found in Cloudflare’s cache”; DYNAMIC means not eligible (HTML, by default). x-litespeed-cache comes from LiteSpeed’s page cache (what x-litespeed-cache: miss means), and x-hcdn-cache-status from Hostinger’s CDN on this site. Background: how a CDN caches files.
5. Lighthouse
Chrome’s docs say the old “Serve static assets with an efficient cache policy” audit (uses-long-cache-ttl) was replaced by the use-cache-insight audit, shown as Use efficient cache lifetimes, in Lighthouse 13. It asks for “a cache lifetime of at least 30 days (2592000 seconds)” on fonts, images, media, scripts and style sheets, not the HTML page.

What Values to Use
| Response | Suggested Cache-Control | Why |
|---|---|---|
| CSS, JS, fonts, images with a version in the URL | public, max-age=31536000, immutable | A new version gets a new URL (public is optional). |
| Static files whose URL never changes | A shorter max-age, such as a week | Visitors keep the old file until it expires. |
| HTML pages | no-cache, or a short max-age | Visitors get new HTML and the new asset URLs in it (MDN). |
| Logged-in, cart or account pages | private, or no-store for sensitive data | Keeps them out of shared caches. |
Many CSS and JS URLs carry a version string (this site’s JS ends in ?ver=aa5e7); its uploaded logo URL has none. RFC 9111 adds that no-store “is not a reliable or sufficient mechanism for ensuring privacy”. On Cloudflare, don’t pair s-maxage with stale-while-revalidate: its docs say s-maxage “prevents shared caches from serving stale content”.
How to Set It on Your Platform
| Where your site runs | What to do |
|---|---|
| Cloudflare | Caching → Configuration → Browser Cache TTL (default 4 hours). It replaces lower or missing origin values unless you pick Respect Existing Headers. Cache Rules can set Browser TTL per rule. |
| LiteSpeed Cache plugin | Cache → Browser: turn on Browser Cache (off by default in the docs); Browser Cache TTL 31557600 is the recommended value. |
| LiteSpeed server | WebAdmin → Server → General → Expires Settings. LiteSpeed warns that Expires Default “applies to all content types, including HTML”; leave it unset if you use LSCache. |
| Hostinger | Use the LiteSpeed Cache plugin’s Browser tab or an .htaccess block like the one below. If you copy Hostinger’s 2021 tutorial, drop its ExpiresDefault “access plus 7 days” line, which also covers HTML. |
| Apache | mod_expires sets max-age and Expires; use mod_headers (Header set Cache-Control) for other directives. |
| nginx | expires (default off) sets Expires and max-age; add_header Cache-Control for anything else. |
An Apache example for static files (in .htaccess or the server config):
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
</IfModule>And an nginx one, inside your server block:
location ~* \.(css|js|webp|png|jpg|svg|woff2)$ {
expires 365d;
}I wrote both from the docs but didn’t run them on a test server. ExpiresByType must match the Content-Type your server sends: this site serves JS as application/x-javascript, which Hostinger’s text/x-javascript line wouldn’t match. In nginx, an add_header inside a location stops it inheriting add_header lines from above. Using LiteSpeed Cache? See LiteSpeed Cache settings.
Why Your Changes Don’t Show
The browser, the CDN and the page cache each keep their own copy. Purging one doesn’t always clear the others, and no server-side purge reaches a visitor’s browser. Cloudflare: “Purging Cloudflare’s cache does not affect assets stored by a visitor’s browser.” A file with a one-year max-age and an unchanged URL stays old for returning visitors. To fix it, clear every cache layer on Hostinger or purge LiteSpeed Cache, give the changed file a new URL (a new version string or file name), then recheck with curl.
Does Cache-Control Help Speed and SEO?
It lets repeat visitors skip downloads. I found no Google statement that Cache-Control is a ranking factor. Google’s Search Central blog (December 2024) says its crawlers support caching through ETag and Last-Modified, and suggests setting max-age “to help crawlers determine when to recrawl the specific URL”. I didn’t measure load times, so I make no speed claim. Caching works alongside Gzip or Brotli compression, not instead of it.
Mistakes to Avoid
- Reading no-cache as “don’t cache”. It allows storing; use no-store to forbid it.
- A catch-all default that covers HTML. It can serve visitors stale pages.
- public on personal pages. MDN warns personal content in a shared cache can leak to other users.
- Checking only with curl -I. Cloudflare’s HEAD and GET answers differed in my test.
- Purging the CDN and expecting browsers to update. Browser copies stay until they expire or the URL changes.

Checklist in text: check Cache-Control with a GET for the HTML, a CSS, a JS and an image file; give versioned static files at least 30 days (a year is common) plus immutable; give HTML no-cache or a short max-age; mark personal pages private; avoid catch-all defaults that cover HTML; read Age and the CDN status header; after changes, purge the page cache and CDN and change asset URLs.
What does Cache-Control max-age mean?
It’s the number of seconds a stored copy stays fresh. max-age=31536000 is one year (365 days); max-age=0 makes it stale at once, so caches normally check with the server before reusing it.
What is the difference between no-cache and no-store?
no-cache lets caches keep a copy but check with the server before each reuse. no-store says keep no copy.
What is s-maxage in Cache-Control?
A lifetime for shared caches such as CDNs only. Browsers ignore it.
How do I check the Cache-Control header of a website?
In Chrome DevTools (F12), open Network, reload, click a request and read cache-control. Or run curl -sS -o /dev/null -D – https://site.com/ | grep -i cache-control (in PowerShell: curl.exe -sS -o NUL -D – https://site.com/ | findstr /i cache-control).
How do I fix “Use efficient cache lifetimes” in Lighthouse?
Give the listed files a max-age of at least 30 days (2592000 seconds) through your CDN, LiteSpeed Cache’s Browser tab, Apache mod_expires or nginx expires. Other domains’ files are up to their owners.
Should HTML pages have a long Cache-Control max-age?
Usually not; returning visitors may see old pages. MDN suggests no-cache.



