JS/CSS won't uncache without a purge

Even after the weekend, my JS/CSS files for my Pages deployment are still being cached. I have to run a Purge Cache on those files on every deploy to get them uncached. I thought a deployment would automatically clear those files from the cache. Any strategies to fix this issue? Is it common and I just don't know what to search for? Thank you!
8 Replies
Hello, I’m Allie!
I would recommend deploying a cache rule to mark hostnames that use Pages as ineligible for Cache.
Jacob Wright
Jacob Wright3mo ago
Thank you. Is this something that everybody does? Is this a common issue?
kerm
kerm3mo ago
I think I'm facing a similar issue, I noticed one user is still getting served stale data that was updated almost a week ago. Just added the cache rule as well so we'll see if that fixes anything. How are you able to see if the files are uncached?
Hello, I’m Allie!
Check the CF-Cache-Status header Not explicitly, though sometimes you may have another cache rule, or something else causing assets to be cached when they shouldn’t be
kerm
kerm3mo ago
it's set to DYNAMIC but I also see Cache-Control: no-cache which wasn't there before, promising! but I find it hard to believe that without that cache rule a user would cache the request for nearly a week now
Nel:
{"success_fraction":0,"report_to":"cf-nel","max_age":604800}

Report-To:
{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=rtfZ5qpuEcO4FqqY7bbNQPo320P3a3vU8zSRiHdWyAdZ7PAezU4AUHI9s0WWUw0CWbcWsmocalPL0hbku4ERZbeiACudrBiL2hVHOSbOJwSokfYvrc9%2FbEPzK4%2Bu"}],"group":"cf-nel","max_age":604800}
Nel:
{"success_fraction":0,"report_to":"cf-nel","max_age":604800}

Report-To:
{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=rtfZ5qpuEcO4FqqY7bbNQPo320P3a3vU8zSRiHdWyAdZ7PAezU4AUHI9s0WWUw0CWbcWsmocalPL0hbku4ERZbeiACudrBiL2hVHOSbOJwSokfYvrc9%2FbEPzK4%2Bu"}],"group":"cf-nel","max_age":604800}
I did see these 2 fields that have max_age of 7 days 🤔 but they seem like irrelevant fields
Hello, I’m Allie!
Just to check, can you see if it is cached on their device? Adding a Cache Bypass does not prevent client-side caching, unless you explicitly enable it. And even then, it will only apply when the asset in question is refetched
kerm
kerm3mo ago
no is there a way I can do that? the way I'm determining that now is with inconsistencies in their database entries that make it apparent they are using outdatated data from 6 days ago
Jacob Wright
Jacob Wright3mo ago
My issue was fixed when I purged the cache, so it wasn't a client-side cache causing the issue. I'll add a rule I guess.
Want results from more Discord servers?
Add your server
More Posts