
Caching: why your browser keeps serving yesterday's newspaper
Greg returned to the Cookie Hotel and asked reception for today's newspaper. He got yesterday's edition. The front page still announced the hotel's grand opening, although the sign had since fallen off and the manager had been replaced twice. The receptionist insisted everything was fine. After all, the paper was perfectly clean. 📄🤣
Yesterday's paper is practically new
— Good morning, I'd like today's breakfast timetable — said Greg.
— Coming right up — the receptionist reached under the counter.
— But this says breakfast ends at ten! They moved it to eleven today.
— This copy is in excellent condition.
— BECAUSE IT'S FROM YESTERDAY!
— And I didn't have to run to the printing office.
That is the idea behind the browser cache. Your browser may keep copies of previously downloaded website resources — images, CSS stylesheets, JavaScript files and sometimes HTML documents — so it doesn't have to download everything again on the next visit.
— You keep spare newspapers under the counter?
— Yes. Faster service, less data transfer and fewer trips to the printer.
— But what happens when the newspaper changes?
— That's when things get interesting, Greg.
New webpage, old button
The hotel's developer updated the reservation website, changed a button's color and fixed a broken form. Everything was ready on the server.
— Does it work? — asked the manager.
— Works on my machine.
— What about Greg's?
Greg refreshed the website and saw the old button.
— I'M STILL LOOKING AT THE OLD VERSION!
— Please don't shout. Your browser may have an older copy of the CSS or JavaScript file — the developer replied.
A webpage often consists of many separate resources. Even when the HTML document is current, an older stylesheet or script can make the site look or behave differently from what its author intended. That's why the famous phrase “works on my machine” rarely ends an argument.
— Is my computer broken?
— Not necessarily. Sometimes it's just trying too hard to help.
— TELL IT TO STOP!
Who decides how long to keep a paper?
The developer started attaching little notes to the newspapers.
— This leaflet can stay fresh for an hour. That picture can stay longer. And this document must not be stored.
— How is the receptionist supposed to know? — asked the manager.
— The server sends instructions.
In HTTP responses, servers can use the Cache-Control header. For example, max-age=3600 sets a freshness lifetime of 3600 seconds. no-cache doesn't mean “do not store”: a copy may be stored, but it must be validated before reuse. no-store, on the other hand, instructs caches not to store the response.
— So “no-cache” doesn't mean no cache?
— Correct.
— WHO NAMED IT?!
— Please don't ask. This is computing.
Actual behavior also depends on the browser, request context and other cache directives. The label is an HTTP instruction, not an eternal date stamped on every newspaper.
Could you check whether this is still the same edition?
The next day, the receptionist found a newspaper under the desk without a clear indication that it was still current.
— Throw it out? — asked Greg.
— I'll call the publisher first.
— Are you going to download the whole thing again?
— No, just ask whether it changed.
A server can label a resource with an ETag or a Last-Modified timestamp. During revalidation, the browser may send a conditional request using If-None-Match or If-Modified-Since. If the cached copy is still valid, the server can reply 304 Not Modified without sending the entire content again.
— What did the publisher say?
— “Not modified”.
— Why did we even call?
— So we know we don't need another delivery.
— A phone call is cheaper than a truck.
— Now you're getting it.
Refresh, refresh harder, then don't panic
Greg pressed Refresh.
— Still old.
He pressed it again.
— STILL OLD!
— Clicking twice doesn't always impress the server more — sighed the developer.
A normal refresh often triggers revalidation, but exact behavior varies by browser. There is also a hard reload, which typically forces resource fetching while bypassing some ordinary cached copies. Keyboard shortcuts and precise behavior vary by browser and operating system.
— What about “Clear browsing data”?
— That's heavier artillery. You can remove cached files, but make sure you choose the right category.
— What if I tick everything?
— You might also delete cookies and get signed out of websites.
— I JUST WANTED A NEW BUTTON, NOT A NEW LIFE!
Browser cache is different from cookies, browsing history and saved passwords. Check what a cleanup action will actually remove before clicking it.
The developer has a few tricks, too
The manager demanded a solution that didn't require teaching each hotel guest how hard to press Refresh.
— We can set sensible caching rules — explained the developer. — And give changed resources new URLs, perhaps with a version number in the filename.
— Like “newspaper-2026-11-08.css”?
— Something like that. Often we use a hash of the file contents.
When a resource URL changes, the browser treats it as a new resource. Static files with versioned names can therefore be cached for a long time while updated pages refer to the new versions. It's a common way to avoid stale CSS and JavaScript problems.
— And if the URL stays the same?
— Then we need appropriate freshness and validation rules.
— Put that in our procedures.
— Already done.
— Where?
— In the document you forgot to refresh yesterday.
Final report: why have a cupboard at all?
At last the receptionist brought the current newspaper.
— There! Was that so difficult? — Greg announced.
— No. Just remember that if we printed every guest the same images again every day, the hotel's Internet connection would give up before breakfast.
The browser cache speeds up page loading and reduces unnecessary downloads. Trouble starts when an old copy is reused where a new one is needed. Good server settings and sensible resource versioning help browsers save time without passing off yesterday's news as today's.
— What about cookies?
— Cloakroom tickets, not newspapers.
— And browsing history?
— A list of what you've read.
— Three different things?
— Yes.
— Computing needs more drawers.
The Cookie Hotel management reports: reception has introduced new newspaper storage rules. Old editions will be checked before reuse, and new copies will receive dates and labels. Greg proudly opened the updated breakfast timetable. Then he saved a screenshot to his desktop and spent the next three days complaining that nothing ever updated. 🗞️💻🤣❤️
