Skip to main content

Browser Cache

Updated: October 29, 2026
By Willya Randika

Browser cache is a copy of assets (CSS, JS, images, fonts) stored on the visitor's device. On a return visit, the browser can use the local copy without asking the server again.

The headers that control it

HeaderRole
Cache-ControlMain rule: max-age, public, private, no-store
ExpiresLegacy expiry time; some servers still send it
ETagFile fingerprint for If-None-Match validation
Last-ModifiedLast change time for validation

A common example:

Cache-Control: public, max-age=31536000, immutable

Use it for assets whose filenames contain a hash (app.3f9c2.js). For HTML, use no-cache or a short max-age so changes appear quickly.

Cache busting

If the filename stays the same, the browser may keep using the old version. Change the filename during the build (app.[hash].js) or add a version query. Do not rely on ?v=1 for every asset without changing it on deploy.

What to watch for

  • Browser cache and CDN cache are different. Each has its own rules.
  • Do not cache old HTML. Pages can show stale content after a deploy.
  • Use no-store for sensitive data. Do not put account pages in a public cache.
  • Test after deploy. A hard reload or Incognito helps confirm the new version.
  • 304 is a healthy response. The browser uses its cache and the server saves bandwidth.

Every deploy should produce new asset filenames. If HTML is cached too long, visitors can see links to old assets that no longer exist. Test in Incognito after deploy and keep HTML and static-asset Cache-Control policies separate.

FAQ

Does browser cache make a site faster?

Yes, on repeat visits. Assets already stored do not need to be downloaded again.

Why do CSS changes not appear?

The browser is probably using its cache. Use hashed filenames for cache busting or a hard reload while testing.

What is the difference between no-cache and no-store?

no-cache still stores a copy but must revalidate it. no-store does not store it at all and is stricter for sensitive data.

Disclaimer: Hosting Wiki articles are prepared for educational and reference purposes. Hosting technology keeps evolving, so some technical details may change over time.