Skip to content

Commit 510d7b5

Browse files
committed
Remove SW caches
1 parent 4006374 commit 510d7b5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/_api/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ if (config.api.useMocks) {
1111

1212
const init = async () => {
1313
if (apiMocks) {
14+
// Remove all SW caches
15+
const cachesNames = await caches.keys()
16+
17+
await Promise.all(cachesNames.map(name => caches.delete(name)))
18+
1419
await apiMocks.default.init()
1520
}
1621

0 commit comments

Comments
 (0)