Deployed a new version and some visitors still see the old site for days — how do I force them onto the new one?
Static site. Deployed changes, checked in a private window and it looked right, then had three people tell me they were still seeing the previous version. One of them was still on it four days later.
Hard refresh fixes it for them, but I cannot ask every visitor to do that.
What I want to understand:
- Where is the old copy actually being kept? There seem to be several possible places.
- Why does it persist for days when I never set anything like that?
- What is the correct way to structure this so it stops being a problem on every deploy?
@fare_class_fay · 2h ago
On question 2: you did set something, in the sense that not setting anything is itself a choice.
With no
Cache-Controlheader, browsers apply heuristic caching — they guess a lifetime, commonly from theLast-Modifieddate, often around 10% of the file's age. A file that has been unchanged for a year gets guessed a long life. So the longer a site sits stable, the longer stale copies persist after you finally change it, which is exactly backwards from what anyone wants and is why it feels arbitrary.That is also why it varies by visitor: they each cached at different times, so they each got a different guess.
The lesson is that silence is not neutral. Every response should say what it wants, explicitly.
Reply
Report