From 0a56dcca1b2b952d80c5d1f9afe3fd9a1a9cd090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Sat, 6 Jul 2024 19:04:23 -0300 Subject: [PATCH] index: Erase browser cache with settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix problems where the browser is still using old cached files Signed-off-by: Patrick José Pereira --- index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.html b/index.html index 29629966e..2f03d949f 100644 --- a/index.html +++ b/index.html @@ -57,6 +57,11 @@ clearSettingsButton.addEventListener('click', function() { localStorage.clear(); + // We are also going to clear the cache to ensure a fresh access to all files as well + if (caches) { + const keys = await caches.keys(); + await Promise.allSettled(keys.map((key) => caches.delete(key))); + } location.reload(); }); })