Forum Moderators: open

Message Too Old, No Replies

Can't reliably clear cache for a single site

         

Rsw0001

5:25 am on Mar 20, 2022 (gmt 0)

10+ Year Member



I'm in the process of editing some pages on my website, and I'm using Firefox to check the results. If I click the reload icon on Firefox, it will reload the current page, but not necessarily the related css files. So, I can't see the results of any changes that I've just made to the css file. Sometimes I can force it to reload the css file by closing the tab and then opening it again, but that doesn't always work either. Sometimes I have to completely quit Firefox and restart it.
Going into Firefox's Settings>Privacy&Security>Cookies&SiteData>ManageData... doesn't help, because my site doesn't show up on the list of sites that comes up (probably because my site doesn't use cookies).

Is there any reliable way to force Firefox to load all of the related files for a site, without having to clear its entire cache?

I'm using the latest Firefox version 98.0.1 on MacOS.

BTW, Safari works fine. If I hit the reload icon it always reloads everything.

not2easy

12:22 pm on Mar 20, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I have set my Firefox to use a cache size of "0" so it always reloads everything - just for that reason. Also using 98.0.1 on OSX.

You can find the settings and information here: https://support.mozilla.org/en-US/kb/storage?as=u&utm_source=inproduct&redirectslug=permission-store-data&redirectlocale=en-US (for en-US) if you need a different environment, you can go to Firefox > Preferences > Privacy & Security and under "Cookies and Site Data it shows the current settings with "Learn More" links to make changes.

NickMNS

5:12 pm on Mar 20, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Open "Dev-Tools", "Ctrl, Shift I". Then open the storage tab, and select cache, and then you can delete or inspect whatever you need.

More info here:
[developer.mozilla.org...]

Kendo

1:12 am on Mar 21, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If clearing browser cache fails, take a dispirin and try again tomorrow because some ISPs and some webhosts force cache retention to save on data costs.

phranque

1:36 am on Mar 21, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



the cookie situation is irrelevant to cached resources.

what matters most is what cache control-relevant headers are sent with the HTTP Request (Etag, If-Match, If-Modified-Since, If-None-Match) and the HTTP Response (Cache-Control, Content-Location, Date, ETag, Expires, Last-Modified, and Vary)

Rsw0001

2:17 am on Mar 21, 2022 (gmt 0)

10+ Year Member



Open "Dev-Tools", "Ctrl, Shift I". Then open the storage tab, and select cache, and then you can delete or inspect whatever you need.

I did this, and under the "Storage" tab every option (Cache Storage, Cookies, Indexed DB, Local Storage, Session Storage) shows "No data present for selected host."
Under the "Style Editor" tab it shows the css file and looking at the contents, it's definitely not the updated version. I was hoping there might be an option there to force it to reload, but I couldn't find any such command.

what matters most is what cache control-relevant headers are sent with the HTTP Request...

Is there any way to change this in Firefox?

I may just have to swallow my pride and use Safari for debugging, at least until I get the css file essentially complete.

NickMNS

2:41 am on Mar 21, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If the "storage" shows "no-data present" than the issue lies at the server end and has nothing to do with browser. This can be confirmed by using the network tab, the request for the css file will show if it came from the browser cache or from the server. But this doesn't explain why it would work on Safari and not Firefox, maybe has something to do with Safari's privacy settings. Have you tried using "private browsing" mode in Firefox?

Are you using Cloudflare? If so you need to switch into "dev-mode", or purge the file from the cache manually.

@phranque
what matters most is what cache control-relevant headers are sent with the HTTP Request (Etag, If-Match, If-Modified-Since, If-None-Match) and the HTTP Response (Cache-Control, Content-Location, Date, ETag, Expires, Last-Modified, and Vary)

If you clear the cache, then shouldn't headers be irrelevant? If the data is not in the cache it needs to be fetched again regardless, at which point the server should send the new files. Unless the files are cached in between, eg: Clouflare or other CDN service.

Rsw0001

3:43 am on Mar 21, 2022 (gmt 0)

10+ Year Member



I decided to completely clear Firefox's cache, and now it seems to update everything whenever I click the reload button. I wonder if the cache was corrupted, and maybe that was causing the problems. It wouldn't be the first time.

At the moment I'm serving the files on my own development computer using Python's SimpleHTTPServer. At first, I thought maybe this might be the problem, but I doubt that SimpleHTTPServer is clever enough to do any caching, and there wouldn't really be any benefit from a performance aspect. I was previously using Firefox to access the site files directly, but that created some problems with Firefox's security.

phranque

10:10 am on Mar 21, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



If you clear the cache, then shouldn't headers be irrelevant?

if you clear cache, it will be evident in the headers sent with the request.

until we see the relevant headers, we are just guessing what the problem is...