#Cloudflare is using old js files even after deployment and 'Purge Everything'

49 messages · Page 1 of 1 (latest)

slate kayak
#

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

haughty bone
slate kayak
#

@wild wagon

wild wagon
#

hi @haughty bone 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

#

@haughty bone any idea? We are a SaaS service and this is keeping all of our users away from using the product

haughty bone
#

If they have to revalidate before the expiration, it might go a bit faster

thorn cliff
#

you can change the url of the file being requested, to change the cache key

haughty bone
#

Oh yeah, that

thorn cliff
#

(this is what most modern frameworks do, hence index-H3974.js and similar file names

haughty bone
#

If your HTML, or whatever is calling the JS, isn't cached too, anyway

thorn cliff
#

so if the content changes, it's a new file and not cached

thorn cliff
wild wagon
#

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?

haughty bone
thorn cliff
#

that won't help if it was cached on the client side, and also exposes your origin

wild wagon
#

cache purging helps?

#

does me pushing a new build help?

haughty bone
wild wagon
#

they do change but I am still unable to load it

haughty bone
wild wagon
#

JS files

#

these are all minified/autogenerated ones

haughty bone
wild wagon
#

no, I don't think so

#

@haughty bone 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 @thorn cliff if this works

thorn cliff
#

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)

wild wagon
#

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

thorn cliff
#

🤨 that's weird

wild wagon
#

currently I am full on cloudfront, but it still persists (as I have disabled cloudflare)

#

any ideas @thorn cliff ?

wild wagon
#

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

haughty bone
#

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

wild wagon
#

in the disk cache, as in the clients pc?

haughty bone
wild wagon
#

ok, I see 24h caching time over there

#

so there is no way we can force this caching removal from our side?

thorn cliff
#

only if you rename the files

#

or append a querystring, like index.js?version=2