
The short answer: every file the server sends comes with a few lines the visitor never sees, the headers. Some of them tell whoever receives the file whether it may keep it, for how long, and how to check later whether it changed. Browsers read them, and so does a CDN. Nearly every cache surprise (the old file that will not go away, a personal page handed to someone else, a CDN that caches nothing) starts in one of these headers. We do not sell a CDN: what follows applies to whichever CDN you choose, on an account of your own, opened directly with that provider.
The headers that matter
| Header | What it tells a cache |
| Cache-Control: max-age | How many seconds the copy counts as fresh. While it is, the browser and the CDN use it without asking the server anything. |
| s-maxage | The same lifetime, but only for shared caches (CDNs and proxies). When present, the CDN uses it instead of max-age. It lets the CDN keep a copy longer than the browser does, or shorter. |
| public and private | public: any cache may store it. private: only the visitor’s own browser; a CDN should not store it. This is what personal pages use. |
| no-cache | It may be stored, but it must be checked with the server before every use. Despite the name, it does not forbid storing. |
| no-store | Do not store it anywhere. For personal or sensitive content. |
| Expires | The old way of giving a lifetime, as a fixed date and time. If max-age is present, max-age wins. |
| ETag and Last-Modified | A fingerprint and the date of the version. They answer the question “has it changed?”: whoever holds the copy sends If-None-Match or If-Modified-Since, and if nothing changed the server answers 304 Not Modified without sending the file again. |
| Vary | Says the response depends on another request header (for example Accept-Encoding). The CDN keeps one copy per variant. A Vary: Cookie or Vary: User-Agent can leave the CDN with almost no hits. |
| Age | Added by the cache: how many seconds that copy has been stored. If you see it, the response came from a cache and not from the server. |
Seeing and fixing your site’s headers
|
|
|
|
|
|
| Do not force the CDN to cache everything regardless of headers. A response carrying Set-Cookie or private is personal. If a “cache everything” rule overrides that, the CDN hands the response to whoever comes next: swapped sessions, someone else’s cart. See what must never be cached. |
| Two clocks, two lifetimes. You can purge the CDN’s cache whenever you like; you cannot purge your visitors’ browsers. So it pays to give the CDN the longer lifetime (s-maxage) and the browser a shorter one (max-age), except for files with a version in the name. |
|
Your site’s headers do not say what you expected? Send us the file address and what curl -sI shows. Open a support ticket |
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from KSh858.00/mo (3-year plan, with coupon) See plans |











