Mozilla VPN is currently experiencing an outage. Our team is actively working to resolve the issue. Please check the status page for real-time updates. Thank you for your patience.

為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

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

了解更多

Cookies and site data - keeping it clean

more options

This is on fIrefox version 85 in Linux.

Last week I was discouraged to find out that my cache was taking up 2 GB of space, some YEARS old. So I decided to purge it and then keep it clean.

The cache gets stored in two places: the linux home .cache folder AND the firefox profile's cache2 folder.

To keep things REALLY clean I checked the "Delete cookies and site data when Firefox is closed" checkbox, then manually enter the exceptions for web sites I do not want to block. Then I specifically added sites I really despise (google, for example) to the block list.

The data still gets cached, even after closing and reopening the browser the cache is still there (verified both via about:cache and by just looking in the folders).

Even when I purge the cache completely, verify nothing is there (about:cache) after deleting the cache folders from the hard drive, it keeps coming back, like a bad computer virus.

My interim solution is a crontab that runs every hour to clear old cache, but that seems silly. Do these security settings actually do anything? What am I doing wrong?

This is on fIrefox version 85 in Linux. Last week I was discouraged to find out that my cache was taking up 2 GB of space, some YEARS old. So I decided to purge it and then keep it clean. The cache gets stored in two places: the linux home .cache folder AND the firefox profile's cache2 folder. To keep things REALLY clean I checked the "Delete cookies and site data when Firefox is closed" checkbox, then manually enter the exceptions for web sites I do not want to block. Then I specifically added sites I really despise (google, for example) to the block list. The data still gets cached, even after closing and reopening the browser the cache is still there (verified both via about:cache and by just looking in the folders). Even when I purge the cache completely, verify nothing is there (about:cache) after deleting the cache folders from the hard drive, it keeps coming back, like a bad computer virus. My interim solution is a crontab that runs every hour to clear old cache, but that seems silly. Do these security settings actually do anything? What am I doing wrong?
附加的畫面擷圖

被選擇的解決方法

jscher2000 said

Cookies and site data ("local storage", which works somewhat similarly to cookies) are managed separately from the web cache. Under the History section of the page, change to "Firefox will: Use custom settings for history" to reveal detailed settings. You can use the checkbox for "Clear history when Firefox closes" and the settings box to the right to wipe the cache during a normal quit. If you want to save any cookies (if you created Allow exceptions), then do not clear cookies through this feature, keep using the other feature for that.

Yes, that was it. So the "about:cache/disk" information section is really the "history" data. That is confusing as the cache is split into two parts and two folders, but I assume this has something to do with how browsers developed over time.

It works now, and I did as you suggested w.r.t. the cookies, but again, strange it is set in two places. Maybe this needs to be cleaned up/consolidated? (not that I could do any better...)

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

所有回覆 (6)

more options

Cookies and site data ("local storage", which works somewhat similarly to cookies) are managed separately from the web cache.

Under the History section of the page, change to "Firefox will: Use custom settings for history" to reveal detailed settings. You can use the checkbox for "Clear history when Firefox closes" and the settings box to the right to wipe the cache during a normal quit. If you want to save any cookies (if you created Allow exceptions), then do not clear cookies through this feature, keep using the other feature for that.

more options

If there is a cache or cache2 folder in the main profile location in ~/.mozilla then this is likely a leftover from a long past. The normal location for the disk cache in current releases is in ~/.cache/mozilla/firefox/ as you can see on the about:cache page.

more options

選擇的解決方法

jscher2000 said

Cookies and site data ("local storage", which works somewhat similarly to cookies) are managed separately from the web cache. Under the History section of the page, change to "Firefox will: Use custom settings for history" to reveal detailed settings. You can use the checkbox for "Clear history when Firefox closes" and the settings box to the right to wipe the cache during a normal quit. If you want to save any cookies (if you created Allow exceptions), then do not clear cookies through this feature, keep using the other feature for that.

Yes, that was it. So the "about:cache/disk" information section is really the "history" data. That is confusing as the cache is split into two parts and two folders, but I assume this has something to do with how browsers developed over time.

It works now, and I did as you suggested w.r.t. the cookies, but again, strange it is set in two places. Maybe this needs to be cleaned up/consolidated? (not that I could do any better...)

more options

History is used as an umbrella term to refer to several categories/types of data.

The checkbox currently labeled "Delete cookies and site data when Firefox is closed" used to be a select control with the options:

  • Keep until: they expire
  • Keep until: I close Firefox

I don't know whether that was clearer?

more options

jscher2000 said

... I don't know whether that was clearer?

What I was referring to (as being somewhat confusing) is the cache and cookies are controlled in two different places in the preferences:

  • Cookies and Site Data
  • History

Additionally the cache for these is (somehow) split into two different cache folders. As you yourself pointed out, clearing cookies in the history overrides how it works in the Cookies and Site Data section. I was merely suggesting these sections could be (somehow) consolidated and simplified.

But perhaps that is not feasible, I don't know since I still do not understand the difference between the two cache folders - especially since they both seem to be tied to the same profile.

more options

I don't pay much attention to the web cache folder. Perhaps someone else can review what is going on there.

Cookie management is divided between the Tracking Protection settings (what cookies to accept/reject), the Cookies and Site Data settings, and the History (clear at shutdown) settings. That is confusing. I don't know how to fix it.