How to test caching with Cache-Control headers in the browser
To make Chrome, Edge or Firefox go back to the server instead of using a cached response, add the request header Cache-Control: max-age=0 (revalidate with If-None-Match, expect 304) or Cache-Control: no-cache in HeaderDial, scoped to your host. To see how a different caching policy would behave, override the response Cache-Control header. That second technique changes the browser cache in Firefox but not in Chrome, where it only changes what the page's JavaScript sees. The details below were measured, not assumed.
Request and response Cache-Control are different things
On a response, Cache-Control is the server's caching policy: max-age=600 (fresh for ten minutes), no-cache (may be stored, but must be revalidated before every use), no-store (never stored), private (browser only, not shared caches), s-maxage (lifetime in shared caches such as CDNs).
On a request, it is the client asking caches along the way for something: no-cache means "check with the origin before giving me a stored copy", max-age=0 means "a stored copy is only acceptable once revalidated". Pragma: no-cache is the HTTP/1.0 version of the request directive. It is deprecated and only matters to very old intermediaries, which is why DevTools and many tools still send it next to Cache-Control.
What actually happens in the browser
We tested this in November 2026 with HeaderDial 0.1.0, Chrome 159 and Firefox 158. A page called fetch() on a URL whose server sent Cache-Control: max-age=3600 and an ETag; we made three requests and counted what reached the server. Edge uses Chrome's network stack, but we did not test it separately.
| HeaderDial rule | Chrome 159 | Firefox 158 |
|---|---|---|
| No rule | 1 request; the rest from cache | 1 request; the rest from cache |
Request Cache-Control: no-cache | Every request reaches the server, unconditionally (full 200) | Every request reaches the server as a revalidation (If-None-Match, 304) |
Request Cache-Control: max-age=0 | Revalidation every time (304) | Revalidation every time (304) |
Request Pragma: no-cache only | Every request reaches the server, unconditionally | No effect; served from cache |
Response max-age=3600 overridden to no-store | No effect on the cache; served from cache | Not stored; every request reaches the server |
Response no-store overridden to max-age=3600 | Still not cached | Cached; 1 request |
In both browsers, a page reading response.headers.get('cache-control') saw the overridden value. So request headers do reach the browser's own cache logic, and in Chrome no-cache works like a forced reload for matching requests. Response overrides change Firefox's caching decision, but Chrome's cache keeps following what the server really sent.
How this differs from DevTools "Disable cache"
The Disable cache checkbox in the Network panel makes the browser skip its HTTP cache for every request from the inspected tab, but only while DevTools is open. A HeaderDial rule differs in three ways:
- Scope. It follows your filters: one host, one URL pattern, or one request type such as script, in every tab, with DevTools closed.
- Behaviour. With
max-age=0, orno-cachein Firefox, you get conditional requests and304responses. That exercises yourETagandLast-Modifiedhandling, which "Disable cache" skips. - Visibility. The header travels to your CDN and origin, so you can test whether they honour a client's
no-cache. Many CDNs are configured to ignore it; compare theAgeheader and your CDN's cache-status header with and without the rule.
Neither approach touches responses a service worker answers from its own Cache Storage, or pages restored from the back/forward cache, because those never produce a network request. In Chrome, use Bypass for network under Application › Service workers for the first case.
Steps
- Click the HeaderDial icon. If the site-access banner appears, choose Allow on all sites or Only <current host>.
- Name the profile "Revalidate". Click + Request header, type
Cache-Controland entermax-age=0orno-cache. Keep the operation on set. AddPragma: no-cacheas a second row only if old proxies are part of the test. - Open Where it applies and use + Only on… with type Domain for your host, so other sites keep caching normally.
- For response-policy experiments (Firefox), create a second profile with +, click + Response header and enter
Cache-Controlwith the policy to try, such asno-storeormax-age=600. Switch profiles with each one's Active switch. - Reload and watch the Status column in the Network panel, or count requests in your server log.
The curl equivalent
# what the server says
curl -sI https://www.example.com/app.js | grep -i -E '^(cache-control|etag|age|last-modified):'
# ask caches on the way to revalidate
curl -sI -H "Cache-Control: no-cache" -H "Pragma: no-cache" https://www.example.com/app.js
# a conditional request: expect 304 if the ETag still matches
curl -sI -H 'If-None-Match: "abc123"' https://www.example.com/app.js
curl has no cache of its own, so these test the server and any CDN in front of it, not a browser.
Pitfalls
Cache-Control policy works. The page sees your value, but Chrome caches according to the original. Test the policy on the server, or in Firefox.- append adds to the browser's value.
Cache-Controlis on the list of request headers browsers allow appending to, but a reload may already carry its own value. set gives predictable results. - Turn it off afterwards. A forgotten no-cache rule makes every page on that host slower. Give the rows an expiry such as 1 hour, or use the global On/Paused switch.
- Other headers in the response.
ExpiresandVaryaffect caching too. If you override one header, check the others; modifying response headers covers removing or replacing them.
Add to ChromeFirefox: coming soon