0

A client of ours runs a weather site (sort of) with URLs like www.weather-site.com/, www.weather-site.com/today, www.weather-site.com/tomorrow, www.weather-site.com/this-week, and www.weather-site.com/this-month.

The information on these sites changes daily, therefore we have set a cache expiration date of 24 hours:

cache-control: max-age={{seconds-until-midnight}}, must-revalidate
last-modified: {{start-of-day}}

This week our client activated a CDN that overrode our cache-control-header with a new max-age of 30 days for all responses (HTML, JS, CSS, ...).

We already fixed this. But a lot of repeat visitors visited the site before our fix. Therefore, their browsers still show the "Monday versions" of these URLs and will continue to do so for the next ~30 days (until their browser accepts that the cached response got stale).

Since these repeat visitors are the most important ones for our client, this is a huge problem. Especially, because only a few of them will think about clearing their browser cache (it is not that easy for elderly users - especially on mobile).

My question: Is there anything we can do server-side that forces browsers to delete their caches (Especially if the affected users only visit those cached URLs and no fresh routes)?

Thank you for your help and ideas!

gggeorggg
  • 176
  • 1
  • 6
  • This has been discussed here many times. See [Force browser to clear cache](https://stackoverflow.com/questions/1922910/force-browser-to-clear-cache) and similar. If the cached page is the top-level page (i.e. the URL can't change), the short answer is no, you can't do anything about it. – Kevin Christopher Henry Dec 15 '22 at 22:46

0 Answers0