Wordpress cache busting


#1

I’m currently doing some css edits (on theme custom css panel) , and after i finished some of the visitors are still seeing the old css code which i believe because of there browser caching, so i was wondering how to force the visitors browsers to ignore that old local browser cached file and get the newer files from cloudflare?

Currently my cloudflare caching settings is set as the following.
Caching Level: Standard
Browser Cache Expiration: 2 Months
Edge Cache TTL: 1 Month

Thanks


#2

You’d have to change the url for those cached resources. A simple trick is adding a url variable.

EX:

/js/jquery.min.js

becomes

/js/jquery.min.js?v=1

For the future, set that cache expiration to be under 24 hours or so. Then you don’t have to do that url variable trick above.


#3

Thanks jules for your reply, i was wondering what if i changed the browser cache expiration from cloudflare now to 2 hours instead of doing the trick you mentioned, Will that force the browser of the visitor to load a fresh files from cloudflare after 2 hours and ignore the existing browser cache on there computers?


#4

No. The browser isn’t going to check back until the two months are up.

Changing the value to 2 hours only alerts the browser to the expiration IF the browser pulls the resource again…which it won’t, because you told it not to pull the resource again for two months.