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
Hello, I’m Allie!
Have your clients purged their caches in their browsers?
VleraZhubi
VleraZhubiOP9mo ago
@ilirosmanaj
ilirosmanaj
ilirosmanaj9mo ago
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
Hello, I’m Allie!
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
DaniFoldi
DaniFoldi9mo ago
you can change the url of the file being requested, to change the cache key
Hello, I’m Allie!
Oh yeah, that
DaniFoldi
DaniFoldi9mo ago
(this is what most modern frameworks do, hence index-H3974.js and similar file names
Hello, I’m Allie!
If your HTML, or whatever is calling the JS, isn't cached too, anyway
DaniFoldi
DaniFoldi9mo ago
so if the content changes, it's a new file and not cached yeah I would advise against caching the html on client side
ilirosmanaj
ilirosmanaj9mo ago
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?
Hello, I’m Allie!
Not really, unless the HTML has changed
DaniFoldi
DaniFoldi9mo ago
that won't help if it was cached on the client side, and also exposes your origin
ilirosmanaj
ilirosmanaj9mo ago
cache purging helps? does me pushing a new build help?
Hello, I’m Allie!
Only if the names of the JS files change
ilirosmanaj
ilirosmanaj9mo ago
they do change but I am still unable to load it
Hello, I’m Allie!
Just to check, is the HTML being cached?
ilirosmanaj
ilirosmanaj9mo ago
JS files these are all minified/autogenerated ones
Hello, I’m Allie!
No, I mean the HTML that requests the JS files
ilirosmanaj
ilirosmanaj9mo ago
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
DaniFoldi
DaniFoldi9mo ago
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)
ilirosmanaj
ilirosmanaj9mo ago
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
DaniFoldi
DaniFoldi9mo ago
🤨 that's weird
ilirosmanaj
ilirosmanaj9mo ago
currently I am full on cloudfront, but it still persists (as I have disabled cloudflare)
No description
ilirosmanaj
ilirosmanaj9mo ago
any ideas @PurpleBlob | Rollback ?
ilirosmanaj
ilirosmanaj9mo ago
this is what we see in one of our clients
No description
ilirosmanaj
ilirosmanaj9mo ago
it doesn't work unless you cleared the cache so the status is HIT, even though caching is disabled in cloudflare
Hello, I’m Allie!
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
ilirosmanaj
ilirosmanaj9mo ago
in the disk cache, as in the clients pc?
Hello, I’m Allie!
That is correct
ilirosmanaj
ilirosmanaj9mo ago
ok, I see 24h caching time over there so there is no way we can force this caching removal from our side?
DaniFoldi
DaniFoldi9mo ago
only if you rename the files or append a querystring, like index.js?version=2
ilirosmanaj
ilirosmanaj9mo ago
we've fully removed cloudflare for now, so I guess no other way to go past it
Want results from more Discord servers?
Add your server