Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Question Regarding CSS File Cache

Started by Nimesh 4 years ago · 1 replies · 960 views
4 years ago

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.

4 years ago

@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: /forum/general/cache-busting-and-assets-t4833. Especially reply #8

last edited 06/21/22 by pamtbaau

Suggested topics

Topic Participants Replies Views Activity
General · by themetman, 23 hours ago
2 39 16 hours ago
General · by Hanns Mattes, 1 week ago
0 119 1 week ago
General · by Karmalakas, 1 week ago
2 184 1 week ago
General · by Hanns Mattes, 3 weeks ago
0 234 3 weeks ago
General · by Dima, 4 weeks ago
1 210 4 weeks ago