New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Precached content filesizes are duplicated on page reload #1799
Comments
Does this amount to a bug report about Chrome DevTool's storage quota interface, or do you believe that Workbox is storing more data than it should be? I know that there were several issues with how quota info is displayed in DevTools that the Chrome engineering team was working on—some of them might be better in the current Chrome Canary. Storing new/modified URLs in the |
I believe workbox is storing the precached content somehow duplicated outside of the temp caching. I managed to log it increase in size on first page reload after precaching and then when I actually edited some of my source files the new precache was there waiting on top of that. Meaning when I had precached all my content initially on first page visit, it then duplicated the precached content size(but at least visibly not the files themselves) on a second page load. However the temp cache was empty since source files were not changed and no need to fill the temp cache was there until I actually changed the sources.
While I first noticed said issue in the chrome devtools, I also managed to log the issue with Also in firefox 64.
Yep, this worked as intended. |
While this project of mine was not the one I got the issue with originally, I still managed to at least see some very weird amount of data stored in the cached storage. The site does put a lot of stuff in cache, but it seemed to show much more than it stored. It didn't duplicate, but the amount did not even close to match that of the sizes of the cached files. Using chrome stable |
I don't think that's the case, but you could get a compete dump of the entirety of the Cache Storage API entries for an origin with the following snippet:
If you see multiple entries for resources, not withstanding the expected Otherwise, there are a few issues that I've seen in the past related to how Chrome reports quota usage, and this might be related. Testing in Chrome Canary would help determine whether recent changes have improved things, but it's largely outside of Workbox's control. |
Could not reproduce it anymore on canary nor stable. Might have been a fluke or some other unrelated error in my own project. |
Library Affected:
workbox-sw v. 3.6.3
Browser & Platform:
all browsers
Precached content filesizes are duplicated on page reload:
On initial install the precached assets are added to the storage and when you reload they duplicate in size even though you cannot visibily see it in the cached files themselves in the devtools. The temp cache seems to hang around as empty. And when an actual change happens in the source files the temp cache is again populated making the cache storage now triplicate of the original.
So initially the assets are precached on install (3mb) > reload > it's now 6 mb, yet the files in the actual cache have not changed size > source files change and temp cache is populated > total cache storage is now 12 mb (assuming the sourcefiles size didn't actually change dramatically).
Here is a 15mb file that is the only thing in the cache storage
And here is the total cache storage size displayed after page reload (and sourcefiles have not changed on pagereload
The same issue can also be seen by logging the storage quota and usage, it displays the total as duplicate of the only thing stored in the cache.
The text was updated successfully, but these errors were encountered: