Cache problem: custom.css file isn't updating, old version keeps loading

My child theme has a custom.css file and no matter what edits I make to it, an old cached version keeps being loaded.

I’ve deleted the file from the server and used every “Clear Cache” option available in the admin, yet if I navigate to it in a browser it still gets loaded.

How do I force Grav to update the file, but more importantly why isn’t it updating when I clear the cache?

@Alpha, Did you force the browser to bypass its cache using Ctrl+F5 ?

NB. Sharing the css does not provide much information to us…

In my experience even Ctrl + F5 doesn’t always clear HTTP cache. I usually open dev tools and then click and hold on reload button (at least on Chrome) until menu pops up. Then Empty cache and hard reload

1 Like

@Karmalakas, You’re right, my Devtools are almost always open to catch errors, see css and js, the actual DOM etc.

I took it a step further and tried loading it in two additional browsers (Safari and Firefox) and with standard and incognito modes and sure enough it’s getting loaded. I just now loaded it on my iphone and ipad while at the same time confirming with my host’s cpanel that the file does not exist.

I gave the link in the hopes you could see the file still loading despite the fact its been removed from the server.

Could it be cached on server side then?

That was it! OMG, I’ve spent about two hours going through the forums searching for cache issues and not one post I read mentioned anything about server-side. :face_with_raised_eyebrow:

Hi, I had this in the past and solved it by adding a “?version=xx” or “?id=xx” or whatever at the end of the css syntax. (in your case custom.css?version=00" 01 02 and so on)
it’s a bit annoying because each time you modify the css you have to increase or change the version. But… it works. it’s reading it from cache (navigator or server or proxy) but if you change it, it will be updated.

1 Like