We have written about CDNs and about Core Web Vitals, but not about caching, and that is an omission. Because of the three, caching is often the one that gives the biggest improvement, and it is also the one most often configured wrongly.

Let us clear up the difference first, because people mix them up constantly. A CDN reduces distance. Caching reduces work. The first brings the file closer to the visitor. The second avoids rebuilding the file from scratch. Two different problems needing two different solutions, and you usually want both.

The one directive that does most of it

There are not dozens of settings. There is mainly one header, Cache-Control, and two opposite logics behind using it well.

Before those, some housekeeping. You will find plenty of guides citing RFC 7234 for caching (RFCs are the official technical standards of the internet). It has been obsoleted. The current standard is RFC 9111, “HTTP Caching”, from June 2022. I mention it because it is a good age test: if what you are reading cites 7234, it was written at least four years ago.

Two kinds of file, two opposite logics

Static files with unique names, the ones your build tool emits under a new name every time the content changes, can stay in the browser for a very long time, or as web.dev puts it, “effectively equal to forever”. And that is harmless precisely because the name changes when the content changes: the new file has a different name, so the browser fetches it anyway.

HTML pages need exactly the opposite. The browser may keep a copy, but it has to ask every time whether anything changed before using it. Because your page URL does not change its name when you edit a paragraph, so there is no other way for the browser to learn that something happened.

Getting the balance between the two right is most of the subject, and it is where most mistakes are made.

The name that misleads everyone

no-cache does not mean “do not store”. The Chrome team says so themselves, with unusual candour for documentation: “no-cache is a confusing name, because it could be interpreted as never cache this file, even though that’s not the case”.

It means: store it, but ask before you use it. It is essentially the logic that suits HTML pages.

The one that means “do not store” is no-store, and it is far heavier. It belongs on pages with personal data, on dashboards behind a login, on anything that should not remain on the user’s machine. Not on your home page.

Confusing the two costs you in both directions. Some people put no-store everywhere and kill every improvement, others put no-cache on files that could have sat there for a year.

How many get it right? The honest answer

I would like to give you a percentage, and I looked. There is not one.

The Web Almanac, the largest annual measurement of the web, has no caching chapter in either the 2024 or the 2025 edition. The last one was around 2021. You will find texts saying “only 38% configure headers correctly”. I found no such figure anywhere.

Two related numbers do exist, from other chapters of the 2024 measurement: 21% of sites use Cache-Control: no-store, and 25% of mobile sites use no caching at all. The first is interesting because no-store has a side effect people forget: it stops the page entering the browser’s back/forward cache, so the back button reloads everything.

Two incidents from our own site

Since we have been theoretical so far, let us get specific with our own mistakes.

The first was ours, and we fixed it. mslogic.gr was telling browsers to keep HTML pages for one hour. That sounds reasonable until you think about what it means: you correct a piece of text and a visitor who came by forty minutes ago still sees the old one. We changed it so the browser asks every time, which is exactly the logic described above. Static files stayed as they were, because they have a unique name per version.

The second was more insidious, and it fooled us. After an upload, the page was still showing the previous version even though the header said zero. At the same moment, with a parameter appended to the URL, the new one came back instantly. So the setting was not at fault: there was an intermediate copy on the server that had not refreshed.

I write it up because it has two practical consequences that may apply to you. If you still see the old version after a change, open the URL with a ?v=1 on the end: if the new one appears, the problem is a copy somewhere along the path, not your change. And if an automated check runs immediately after an upload, it may report something missing that is actually there.

The trap that wipes out your security headers

And a warning, because we nearly walked into it. On some servers, if caching rules are added for HTML pages only, those pages silently lose their security headers, such as the Content-Security-Policy. In other words, the very pages that need them most. You would gain a little speed and lose the armour, with no warning anywhere.

So every change to caching needs verifying against what actually reaches the browser, not the configuration files. There is a way to see whether the security headers are still in place, and it is part of our job after every such change.

And the most modern piece

There is a third option few people know: stale-while-revalidate.

It tells the browser: show the old copy immediately, and go and fetch the new one in the background. The visitor sees something almost instantly, and the next load is up to date.

It suits content that changes, but not every minute. On prices changing as we speak or on stock levels, though, it can show the visitor something already out of date.

What to take away

If you have a static site, the subject is usually narrower, but a mistake there shows up immediately to visitors. If you have WordPress, the subject is bigger and has more layers, because there every page is built from scratch on every visit unless somebody stops it.

What both cases share is that it cannot be bought. There is no plugin that gets it right without somebody knowing what outcome they want. And the worst mistake is not having no caching, it is having the wrong caching: serving stale prices to a customer, or keeping data on their machine that should never have stayed there.

Which brings us back to the distinction at the start. A CDN brings the file closer, caching builds it fewer times.

If your visitors still see old prices after a change, or a fix does not show up where it should, we look at it with you and give you our findings in writing. Send us through the form your site address and a page where you saw it. This work is part of maintenance and support.

The whole picture: this article covers one part of a larger subject. If you are after the whole of it, from commissioning to replacement, it is in the guide to your website.