Should cache be purged after every deployment or when performing a rebuild

We are working on a Next.js website that is currently being developed, and occasionally, we need to deploy updates to the production site. After each deployment we are wondering if do we need to purge the Cloudflare cache? And if the changes are too small will it still be worth it to purge?

Our concern for purging the cache is it will slowdown the website which then affect user experience and our SEO.


CSS, JS and images?

Use “Development Mode” option from the Cloudflare dashboard.

Otherwise, make sure to send request on each “build” or “deploy” calling for a resource filetype by using a scheme like → notice the ?ver=123, each time change the value on deply to see the changes (if not using the “Development Mode”).

Kindly, see at the article from below which filetypes are cached by default (which is why you’re suggesting Purging Everything each time):

Thank you for your response.

I apologize for any misunderstanding, but the main focus is not on the assets themselves. We utilize a process called ‘Content fingerprinting’ to prevent caching problems, and the framework takes care of this automatically. Additionally, Google recommends implementing content fingerprinting as a best practice.

Also, there’s a lot of argument about adding query strings to invalidate cache is not the best practice and we had issues with it before.

Our main concern is the website’s content, which is stored and distributed globally by Cloudflare. If we make changes to the content, such as texts, images, or layout, is it recommended to purge the cache?

From my limited experience and testing it does appear to make sense to clear your cache after every deployment. If you don’t, users will not get the latest updates.

I’m actually baffled as to why this isn’t an automatic for Cloudflare Pages deployments.