Does changing browser cache expiration override previous setting?

Hello, I wanted to know if changing the Cloudflare browser cache expiration setting takes place immediately or if you have to wait for the previous setting to expire in the browser before the new one takes effect.
For instance, I uploaded some new images on my site and afterwards when I did not see any changes, realized the browser cache expiration was set to 8 days. I then changed the expiration to 4 hours expecting that after that period of time I would see the changes. I am not seeing the changes coming through, leading me to believe that I have to wait until the 8 days expire before the new browser cache expiration setting takes effect. Can anyone confirm if this is indeed how it works?
Also, just to confirm that there is no browser cache setting coming through from the server, I did a curled the page and the header coming through is: “cache-control: public, max-age=0”. Thanks!

If the browser cache time is set to 8 days, the browser doesn’t update that file for 8 days and won’t re-check the file’s cache-control directive until those 8 days have passed. After that, it’ll re-download the file and then store the file for the new cache expiration duration.

If you just want to just load the updated version on your own browser, reload the page with ctrl/cmd + f5 which will load the page without browser cache. If you’d like every site visitor to have the updated file, you should look into cache busting:

Hi Judge, thank you for clarifying this for me. That is the behavior I suspected but was not sure of. I will definitely look into cache busting. Thanks!

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