2

Chrome/Edge Service Worker 用了一堆 Cache,可以清掉嗎?

 2 years ago
source link: https://blog.darkthread.net/blog/clear-chrome-service-workder-cache/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Chrome/Edge Service Worker 用了一堆 Cache,可以清掉嗎?-黑暗執行緒

人生最常後悔的事之一 - SSD 買太小。

256G SSD C 槽剩不到 10GB 亮起了紅燈,看到系統碟空間不足我就會焦慮,開始動手清廢棄檔。上回學到比 WinDirStat 快 N 倍又能反映真實佔用空間的 WizTree,個人使用免費,是分析磁碟空間不足的首選。

查詢沒發現不合理大檔,就這裡用一點那裡用一點積少成多把空間耗光。這種情況也只能這裡清一點那裡清一點騰出空間來。

我留意到 C:\Users\username\AppData\Local\Microsoft\Edge\User Data\Default\Service Worker\CacheStorage 用掉近 1.8GB:
(如想從檔案總管查看,路徑可輸入 %LocalAppData%\Microsoft\Edge\User Data\Default\Service Worker\CacheStorage,感謝讀者 chriswei 補充)

Fig1_637984589515179368.png

瀏覽器設定裡可以清除包含網際網路暫存檔與網站檔案等瀏覽器資料,但它只會清除使用者設定檔所屬的資料,清不到 Service Worker 的快取。

那這部分要怎麼清?可以手動清掉嗎?

Chrome 討論區有個 Chrome 的 Service Worker 資料夾高達 7.8GB 的案例,有人提到清理所有資料(含 Cookie、瀏覽歷程)的解法,但這會損失所有記錄,而且依據其他討論文章,這個做法清不到 Service Worker 的暫存檔。

StackExchange 這則討論較接近我的理解,你無法透過瀏覽器設定介面清掉它們,用檔案總管吧! 若擔心刪掉會出事,就先備份到其他地方,使用一陣子都沒事再砍。但既然是 Cache,缺少重新下載就好了,出問題的機率不高,我自己實測,砍掉之後沒有任何異樣,應該可以安心清掉。

and has 3 comments

Comments

# 2022-09-11 10:20 AM by chriswei

其實 C:\Users\username\AppData\Local\Microsoft\Edge\User Data\Default\Service Worker\CacheStorage 也可以使用 %localappdata%\Microsoft\Edge\User Data\Default\Service Worker\CacheStorage 替換,會讓讀者更易使用,只是小建議~

# 2022-09-11 10:25 AM by chriswei

另外 Chrome 也有一個和 Edge 一樣對應的 CacheStorage 可以刪除,看來黑大應該是偏用 Edge 所以 Edge 的 CacheStorage 比較肥,但有的人則是 Chrome 的 CacheStorage 資料夾比較肥,hrome 的 CacheStorage 資料夾連結在此: %localappdata%\Google\Chrome\User Data\Default\Service Worker\CacheStorage

Post a comment

Comment
Name Captcha 16 - 15 =

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK