Question Regarding CSS File Cache

Hello,

I have a question, I’m sure it’s easily answered. I’m making edits to my pages, notably CSS edits. When I refresh the page on my smartphone browser (Firefox & Chrome) the CSS file doesn’t re-download and I’m stuck viewing the page the same as before the changes - until I forcefully delete the site cache from the browser and then re-visit, from which it then downloads the CSS again and I can view the changes.

It’s not an issue on the desktop browser but that’s only because I’m using Ctrl + F5 to re-download the CSS. A normal F5 refresh doesn’t work.

I’m unsure how to do this type of refresh on a smartphone browser but more worryingly, people visiting my site won’t be able to see the CSS changes unless they clear cache - a bit tedious to tell everybody to do this.

Is there some code that I need to have on any specific page (or the site as a whole) so it can re-download the CSS every time somebody visits/refreshes a page? (or a setting even).

Thanks.

@njp,

I have a question, I’m sure it’s easily answered.

In which case you might expect there will probably already be a post about it…

Is there some code that I need to have on any specific page (or the site as a whole) so it can re-download the CSS every time somebody visits/refreshes a page? (or a setting even).

This a technique that is often referred to as cache-busting. See this earlier post on this forum: Cache-busting and assets. Especially reply #8