HeaderDial › Guides

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 ruleChrome 159Firefox 158
No rule1 request; the rest from cache1 request; the rest from cache
Request Cache-Control: no-cacheEvery request reaches the server, unconditionally (full 200)Every request reaches the server as a revalidation (If-None-Match, 304)
Request Cache-Control: max-age=0Revalidation every time (304)Revalidation every time (304)
Request Pragma: no-cache onlyEvery request reaches the server, unconditionallyNo effect; served from cache
Response max-age=3600 overridden to no-storeNo effect on the cache; served from cacheNot stored; every request reaches the server
Response no-store overridden to max-age=3600Still not cachedCached; 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:

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

  1. Click the HeaderDial icon. If the site-access banner appears, choose Allow on all sites or Only <current host>.
  2. Name the profile "Revalidate". Click + Request header, type Cache-Control and enter max-age=0 or no-cache. Keep the operation on set. Add Pragma: no-cache as a second row only if old proxies are part of the test.
  3. Open Where it applies and use + Only on… with type Domain for your host, so other sites keep caching normally.
  4. For response-policy experiments (Firefox), create a second profile with +, click + Response header and enter Cache-Control with the policy to try, such as no-store or max-age=600. Switch profiles with each one's Active switch.
  5. 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

Don't use a Chrome response override to conclude that a new 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.

Add to ChromeFirefox: coming soon