feat: clear caches in popup

This commit is contained in:
Gabe
2025-10-15 14:40:58 +08:00
parent 2af1a8b72c
commit 5e67e15842
4 changed files with 13 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
import {
CACHE_NAME,
DEFAULT_CACHE_TIMEOUT,
MSG_CLEAR_CACHES,
MSG_GET_HTTPCACHE,
MSG_PUT_HTTPCACHE,
} from "../config";
@@ -15,7 +16,11 @@ import { blobToBase64 } from "./utils";
*/
export const tryClearCaches = async () => {
try {
caches.delete(CACHE_NAME);
if (isExt && !isBg) {
await sendBgMsg(MSG_CLEAR_CACHES);
} else {
await caches.delete(CACHE_NAME);
}
} catch (err) {
kissLog("clean caches", err);
}