Cloudflare is using old js files even after deployment and 'Purge Everything'
Hello everyone, can someone help me with this issue? A lot of clients are getting old js files which are not anymore and facing issues on the app
32 Replies
Have your clients purged their caches in their browsers?
@ilirosmanaj
hi @HardlyWorkin' if they purge everything (as in do a hard reload and clear cache), then it works, but it;s not really viable
we have so many users that have our tooling on their websites and we cannot ask all of these users to purge their browsers
@HardlyWorkin' any idea? We are a SaaS service and this is keeping all of our users away from using the product
Until their cache expires, I don't think there is much, if anything you can do.
If they have to revalidate before the expiration, it might go a bit faster
you can change the url of the file being requested, to change the cache key
Oh yeah, that
(this is what most modern frameworks do, hence
index-H3974.js
and similar file namesIf your HTML, or whatever is calling the JS, isn't cached too, anyway
so if the content changes, it's a new file and not cached
yeah I would advise against caching the html on client side
yep, we're using VITE for that, as part of our react app
I've completely removed the cloudflare from the proxy of the requests to my app, currently using for DNS only. This should also disable it fully, correct?
Not really, unless the HTML has changed
that won't help if it was cached on the client side, and also exposes your origin
cache purging helps?
does me pushing a new build help?
Only if the names of the JS files change
they do change but I am still unable to load it
Just to check, is the HTML being cached?
JS files
these are all minified/autogenerated ones
No, I mean the HTML that requests the JS files
no, I don't think so
@HardlyWorkin' we're really in a bad spot and would need some help, also as paid as well. Would you be up to jumping on a call with me and our team to check this qucikly?
more than happy to cover your expertise on this
same for @PurpleBlob | Rollback if this works
I can't jump in a call now, but happy to continue to help you :meowwink:
on a browser that's seeing the old files, what's the local cache state? and what's the cf-cache-status header (on the html file, first)
the weird thing Is that I cannot even open the network tab for that on my machine
it is frozen on a weird state that was loading earlier and that caching has not yet been validated
let me check
🤨 that's weird
currently I am full on cloudfront, but it still persists (as I have disabled cloudflare)
any ideas @PurpleBlob | Rollback ?
this is what we see in one of our clients
it doesn't work unless you cleared the cache
so the status is HIT, even though caching is disabled in cloudflare
It's stored in the disk cache
No matter what settings you apply in Cloudflare, if it is cached on the client's disk, and that file is still being called, then it will be served as is
in the disk cache, as in the clients pc?
That is correct
ok, I see 24h caching time over there
so there is no way we can force this caching removal from our side?
only if you rename the files
or append a querystring, like
index.js?version=2
we've fully removed cloudflare for now, so I guess no other way to go past it