New version of static file by etag doesn't work ... or i don't understand

I have a question regarding the update of static files (eg PDF) following an update.
Shouldn’t the ETAG serve to indicate to the browser that a file has changed and thus force the file to be downloaded from the server instead of the CDN?
Do I need to clear the cloudflare cache on time every time I upload a file update?
TKS
Salva

There is no straight answer here, it depends on your setup.

In general, ETags are used to tell a server what version of a file you already have, so that you don’t have to download the same version of an asset that you already have. You can use ETag in combination with suitable cache-control directives to ensure freshness. Remember that there are two caches involved here, Cloudflares Edge Cache, and the users browser cache. You can easily purge one, but the other is not so easy.

It is not essential, but if you can automate a cache purge on file update you can get a very efficient cache setup.

Some useful material is available at these links:

https://www.cloudflare.com/en-gb/learning/cdn/glossary/what-is-cache-control/

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.