I have a javascript file which is frequently updated on the server (every hour). It is a plugin used in websites by the website's users. It is served millions time a day.
In order for users to get the latest copy I use a header with:
cache-control: public,max-age=1800,stale-while-revalidate=3600, immutable
(Safari doesn't support stale-while-revalidate so it is ignored).
When changing the file, all browsers catch up within one hour except than Safari, where small percent of users continue to use old version of the file (could be weeks old). Seems it is caused by returning users (users which got into a website, than got back a week later).
Is there any reason why Safari is using an old version of the file though the max-age is set?