404 cached in Cloudflare?
I had this issue a while back, but was too busy to reach out and figure out what exactly was going on.
Essentially I have a SvelteKit app that may have a file like
index.338f2fbe.js
We had users reporting that the website was broken for them — after debugging we found that this file was 404ing (amongst 1-2 others) — but only for some users.
After a bunch of debugging, my only reasoning was that somewhere down the line, Cloudflare had an issue where this file was unavailable and responded with a 404, then this 404 was cached to our users and their browsers never requested the file again, instead using the cached response.
This was tested by finding a random device that had this error and clearing the browser's cache.
To solve it for all users, I just changed the project's code so that the hash got changed at build. But I'm wondering what actually happened here and how it can be avoided.0 Replies