codesandbox-client icon indicating copy to clipboard operation
codesandbox-client copied to clipboard

Cache Storage gets wiped on reload. How to stop this?

Open adrianloh opened this issue 7 years ago • 4 comments

❔ Question

When I hit reload, the entire Cache Storage gets wiped, including caches I created -- which I need to persist across reloads -- is this expected behavior? Is there a way to stop this?

Link to sandbox: link (optional)

Your Environment

Software Name/Version
Сodesandbox
Browser
Operating System

adrianloh avatar Oct 18 '19 06:10 adrianloh

Hey @adrianloh ,

Can you please provide a link to your sandbox, and detail a bit current vs. expected behavior? Also, what browser are you using?

lbogdan avatar Oct 18 '19 12:10 lbogdan

@adrianloh I'm guessing this is because of this line https://github.com/codesandbox/codesandbox-client/blob/67a5a08568f3373c2afd31f20213c47016a93a91/packages/common/src/registerServiceWorker.ts#L94

it is triggered during the serviceWorker registration, if the installation state is redundant and the navigator.storage.estimate() gives a usage of at least 95% of the available quota. Then the cache is deleted...

lorisdev avatar Jan 09 '20 10:01 lorisdev

Hey @adrianloh ,

Did you figure this out, or it's still an issue for you?

lbogdan avatar Jan 28 '20 21:01 lbogdan

Closed for lack of activity

SaraVieira avatar Sep 03 '20 13:09 SaraVieira