New issue
Advanced search Search tips

Issue 816433 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 801024
Owner: ----
Closed: Feb 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

CacheStorage not cleared

Reported by laurence...@gmail.com, Feb 26 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36

Steps to reproduce the problem:
1. Create a cache object manually in web worker.
2. On update, delete cache object manually.
3. Stop service worker (not required, just to make sure all references are gone)
3. Refresh the page (not required, just to make sure all references are gone)
3. execute navigator.storage.estimate().then(console.log)

What is the expected behavior?
The output of storage.estimate should only show the space used by the new cache.

What went wrong?
It shows the space used by the new and the old while the old is deleted and not accessible anymore.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 64.0.3282.167  Channel: stable
OS Version: 10.0
Flash Version: 

I am trying to cache files using the caching api our use case requires us to cache about 50 - 100Mb.

I use a web worker to sync the files and a service worker to serve them. And when a new version is available i want to delete all old files and sync the new ones.

to clear the whole cache i use:

# (typescript)
return caches.delete(CacheFileStorage.CACHE_KEY).then(() => ...);

And to delete an individual file i use (where this.cache is the instance returned from caches.open():

# (typescript)
return this.cache.delete(filename).then(() => ...);

It looks like the cache is cleared, but storage.estimate isn't reset until all chrome instances are closed. The problem with this is that the application is running in a controlled environment and will be running for multiple months (without even refreshing).

clearing using devtools does reset the quota immediately so i checked the code in github but this looks like an api not available to me.
 

Comment 1 by jsb...@chromium.org, Feb 26 2018

Mergedinto: 801024
Status: Duplicate (was: Unconfirmed)

Sign in to add a comment