Websites

Understanding caching: why changes are not visible straight away

Caches make websites fast. They are also why some visitors still see the old version after an update, and why an error page suddenly reports the wrong status.

Airnite Editorial Team27 November 2026 · 3 min
Published
Reading time
3 min
Author
Airnite Editorial Team

In short

  • Browsers, servers and networks store responses temporarily so they are not reloaded every time.
  • HTML pages should be cached only briefly; versioned CSS, script and image files for a long time.
  • After every upload, check whether the cache really delivers the new version.

What it is about

A new package has been uploaded and all checksums match. Still, a colleague calls: they can still see the old home page. Someone else reports that the new stylesheet is missing and the page looks broken. In almost all such cases the upload is not to blame, but a cache.

Caches sit in several places: in every visitor’s browser, on the web server and often in a network in between that brings content closer to users. They are intended, because they make websites fast and relieve the server. You just have to control what is cached and for how long.

How it works

The rules are described in the RFC 9111 standard. With the Cache-Control header, the server tells the browser how long a response is valid and whether it has to be checked before reuse. A simple split has proven itself. HTML pages get no or a very short cache time, or no-cache, so that the browser briefly asks on every visit whether there is a new version. CSS, scripts, fonts and images, on the other hand, carry a version in the file name and may stay unchanged in the cache for a year. If the file changes, its name changes, and the browser automatically loads it again.

On the server there is often an additional page cache that stores finished responses. It has to be cleared deliberately after every upload.

Where it goes wrong

The most common mistake is files without a version in their name. If site.css is overwritten, browsers keep the old version until their cache time expires. New pages and old styles then do not fit together. The second classic is the forgotten server cache. In one project, an error page occasionally returned status 200 instead of 404 because the server had cached an earlier response. To visitors everything looked right, but to search engines the page was suddenly valid content.

A third mistake is checking in your own browser. If you only look yourself after an upload, you may be seeing your own cache. A request that bypasses the cache and checks status code, headers and checksum is reliable.

How to proceed

Set short cache times or no-cache for HTML. Deliver CSS, scripts, fonts and images with a version or checksum in the file name and allow long cache times with immutable. Clear server and network caches deliberately after every upload. Check live with a request that bypasses the cache, and verify status code, cache headers and checksum. And test error pages again for the correct status code after clearing.

Read more: Measuring PageSpeed properly: lab data, field data, fluctuations, HTTP status codes and soft 404s: what your error page tells Google and Web fonts and loading time: fast without layout shifts.

How Airnite helps

We set up caching rules that make your website fast and still show changes immediately, with versioned files, suitable headers and a live check after every upload. When outdated pages or wrong status codes cause problems, we find the place where the cache is stuck.

Checklist

Sources

Every fact in this article is based on the following publications. Primary sources are marked.

  1. IETFRFC 9111: HTTP CachingStandardPrimary source
  2. web.dev (Google)Prevent unnecessary network requests with the HTTP CacheVendorPrimary source
  3. MDN Web DocsHTTP cachingVendor

Matching services

Read on

Current incidents and warnings are covered in the Zero Day magazine. Go to the magazine

Want to put this into practice in your company?

We assess your situation and tell you clearly what to do. For businesses, in confidence.

Talk to an expert now