wflanagan
wflanagan
CDCloudflare Developers
Created by wflanagan on 8/7/2024 in #general-help
Cloudflare cache (I believe) causing "per user" issues with broken javascript
I have a Rails app. When we produce and push a new version, it expires the previous version of the JS assets. In our deployment process, we call the cache clear API endpoint from Cloudflare. We do this immediately on the deploy. But, the browser, through Cloudflare, we still seems to have the issue that a user's browser will become busted, and all JS won't work. We start getting this error in the browser console: https://cln.sh/ZjmTG6JQ If I go into the app as the user itself, call the Cloudflare API cache and clear it again, and then hard reset the cache in the browser (Shift+ctrl+r), the app JS will refresh and start working. Note that other users may or may not be experiencing this problem. Note that going into "incognito mode" doesn't fix that same browser. Going from Chrome to Safari the problem remains. But, going to Firefox, that browser will work. It seems like it's keeping track of the broad browser type, and caching assets for that user. But, this breaks our app. As an admin, i can hit the Cloudflare API endpoint and fix. But the user experience for our end users is abysmal. We've been assuming this is our problem, and trying patch after patch to fix it for months. What else can I do? It's getting to the point we need to abandon Cloudflare.
24 replies