After deployment, not all assets were updated on the main page
I have a project connected to github with links to *.pages.dev and the main domain
after the last commit *.pages.dev was updated correctly
on the main domain, only the html file (the js remains old)
deleted the local cache
I deleted the old deployments
already tried to restart the deployment several times
watched from different devices
what can be done so that all asserts files are updated to the latest version?
10 Replies
Production branch: main
Automatic deployments: Enabled
Preview
Branches included: All non-Production branches
Automatic deployments: Enabled
Build caching: Disabled
Purging the clouflare cache on the domain has fixed this for us in the past
Oh yes, really
Domain > Caching > Configuration > Purge Cache
And after 30 seconds there was already the latest version of the file
thank you
CF by default caches certain extensions like css/js, which makes logical sense except with Pages which has its own cache layer under it.
https://developers.cloudflare.com/cache/concepts/default-cache-behavior/
You can make a cache rule to disable that cache
Cache Rules are under Caching -> Cache Rules, or magic link: https://dash.cloudflare.com/?to=/:account/:zone/caching/cache-rules/new
otherwise you need to clear it every time or wait it out
this is very helpful for me, thank you
Is my site then slower or are all pages assets deployed to all servers?
I don't understand why Pages doesn't automatically update the cloudflare cache 🤔
wouldn't be too easy I imagine, espec with pages projects having up to 500+ custom domains
Pages uses KV which has its own build in cache
https://developers.cloudflare.com/kv/reference/how-kv-works/
Your html and such was already not being cached by your zone/hitting kv cache, so shouldn't be a big difference. Zone cache can be a bit faster since the pages worker doesn't run but it's minor