搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

Firefox loading pages from cache after latest update

  • 2 回覆
  • 2 有這個問題
  • 25 次檢視
  • 最近回覆由 jscher2000

more options

I do web design. And my problem is that I used to click the refresh button in firefox and it would instantly load an updated version of the pages I was working on. But now it does the exact same thing I hate about chrome. It loads pages using cached css and javascript files. And the only way to view the updated websites is to go private mode which is very annoying. Is there an option to get around this? Or it's a software problem?

被選擇的解決方法

Hi Oleg, Firefox should revalidate cached script files when you use F5/the Reload button/Ctrl+R, but in Firefox 79+, it definitely will not routinely check for updates to cached CSS files before expiration. I agree this is similar to Chrome, based on a test page I built here to compare the two: https://www.jeffersonscher.com/csscache/

So your workaround options include:

(A) On your server, disable caching of .css files

Only practical for development servers, not production servers. However, this would bypass the issue for all browsers you need to test in.

(B) In Firefox, disable caching during development

  • While Dev Tools are open: There is a checkbox for this in the Network Monitor tool. The corresponding preference in about:config is devtools.cache.disabled (double-click to toggle).
  • Completely: In about:config, look for browser.cache.disk.enable and browser.cache.memory.enable (double-click to toggle).

(C) When reloading, bypass the cache

This doesn't require any configuration changes, but there's an extra finger (key) involved each time. Either:

  • Shift+click the Reload button
  • Ctrl+F5
  • Ctrl+Shift+R (seems a bit less reliable than the other two methods)

New workaround as of Sept. 22:

(D) Use an extension to disable caching of .css files from relevant servers

I created an extension that applies cache-control: no-store to text/css responses from hosts you specify:

(Still trying to figure out a good user interface for managing addition and removal of host permissions. Hopefully Firefox will have a native one at some point.)

從原來的回覆中察看解決方案 👍 1

所有回覆 (2)

more options

選擇的解決方法

Hi Oleg, Firefox should revalidate cached script files when you use F5/the Reload button/Ctrl+R, but in Firefox 79+, it definitely will not routinely check for updates to cached CSS files before expiration. I agree this is similar to Chrome, based on a test page I built here to compare the two: https://www.jeffersonscher.com/csscache/

So your workaround options include:

(A) On your server, disable caching of .css files

Only practical for development servers, not production servers. However, this would bypass the issue for all browsers you need to test in.

(B) In Firefox, disable caching during development

  • While Dev Tools are open: There is a checkbox for this in the Network Monitor tool. The corresponding preference in about:config is devtools.cache.disabled (double-click to toggle).
  • Completely: In about:config, look for browser.cache.disk.enable and browser.cache.memory.enable (double-click to toggle).

(C) When reloading, bypass the cache

This doesn't require any configuration changes, but there's an extra finger (key) involved each time. Either:

  • Shift+click the Reload button
  • Ctrl+F5
  • Ctrl+Shift+R (seems a bit less reliable than the other two methods)

New workaround as of Sept. 22:

(D) Use an extension to disable caching of .css files from relevant servers

I created an extension that applies cache-control: no-store to text/css responses from hosts you specify:

(Still trying to figure out a good user interface for managing addition and removal of host permissions. Hopefully Firefox will have a native one at some point.)

由 jscher2000 於 修改

有幫助嗎?

more options

I did end up creating an extension:

https://addons.mozilla.org/firefox/addon/no-cache-no-store-for-css/

It applies cache-control: no-store to text/css responses from hosts you specify. That prevents caching, so they are re-retrieved for a plain F5 or Ctrl+r.

有幫助嗎?

問個問題

如果您還沒有帳號,您必須先 登入您的帳號 來回覆文章。請 開始一個新問題