Skip to content
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

Uncaught (in promise) DOMException: Quota exceeded. sw.js:1 #6

Closed
tomyo opened this issue Jan 6, 2017 · 16 comments
Closed

Uncaught (in promise) DOMException: Quota exceeded. sw.js:1 #6

tomyo opened this issue Jan 6, 2017 · 16 comments

Comments

@tomyo
Copy link

tomyo commented Jan 6, 2017

Using Chrome 54.0.2840.71, sometimes I get this error in console.
If I do a Ctrl+Shift+R, the error doesn't show, if then I do a regular refresh, it appears again (sometimes, many times)
Is this something to be worried about?

Thanks for this code, the app loads faster now! :)

@ilan-schemoul
Copy link
Owner

ilan-schemoul commented Jan 6, 2017

First

Thanks for this code, the app loads faster now! :)

I'm glad about that.

Then quota exceeded probably means that the memory the browser grants by default to a website is exceeded by yours. It probably means that the total size of files SW tries to store in the cache storage is too important. You may want to optimize the size of your assets, you may also want to take a look there because as this article states you may "Ask for a larger storage quota, beyond [the limit of] 5 MB".
But please note that as service worker is still relatively new, the quota each browser grants is not standardized yet nor well documented by editors of these browsers so you may have to make specific test or look in SO investigation about quota to be sure that your SW is gonna working on most browsers possible.

@tomyo
Copy link
Author

tomyo commented Jan 6, 2017

Thanks!
BTW, have you considered making this a package? (Just so people can install it with one simple command, and receive updates).

@ilan-schemoul
Copy link
Owner

ilan-schemoul commented Jan 6, 2017

I would like making it a package but the scope of the service worker depends, for security reasons, to the folder he has been placed. Meteor's package system allows to add static file but the URL of the static file will be something like /package/meteor-service-worker/sw.js so the scope of the SW will only be URL which starts with /packages/meteor-service-worker so unfortunately, and until Meteor add a way to add file to root (discussion about a proposal to implement web/service workers with Meteor meteor/meteor#6222), no packages can register a working SW.
This is a pity and I hope Meteor could improve that a day.

@ilan-schemoul
Copy link
Owner

So is your problem fixed ? If you fix your problem by reducing the memory the SW is using would you mind sharing how you reduce it ?

@tomyo
Copy link
Author

tomyo commented Jan 12, 2017 via email

@Birowsky
Copy link

@NitroBAY I'm not able to find additional resources.. if it's not memory abuse, what else could cause this message?

@ilan-schemoul
Copy link
Owner

It is probably lack of memory. In order to develop more complex strategies about caching I'd need to make a package but Meteor doesn't yet offer the ability to make a package register a Service Worker.

@capi
Copy link

capi commented Aug 24, 2017

It seems to me that this issue is happening in Chrome while in Private Browsing Mode (which I tend to use a lot during development). After about 15 or 20 service worker versions are installed (to purge the cache), I get the Quota Exceeded. In a normal browsing window, I don't get it.

So I think it is related to Private Browsing not having a persistent backing store and maybe leaking memory somewhere. As a side-note: Firefox does not offer Service Workers in Private Browsing at all.

I have been testing with a simple shell-script that keeps modifying the sw.js version string every 10 seconds so that a new service worker is installed and caches are recycled. In Private Browsing I get the issue within a few minutes, in normal browsing mode it has now been running for well over an hour without issues.

@capi
Copy link

capi commented Aug 24, 2017

Ok, not entirely true, after about 300 reloads of the service worker in the same tab (Meteor auto-reload on recompile after sw.js is changed), i also get Quota Exceeded. But closing the tab and re-visiting the site "fixed it". Now starting another run to verify.

@ilan-schemoul
Copy link
Owner

Thanks for sharing these informations, it is interesting.

@Cholowao
Copy link

Cholowao commented Mar 3, 2018

close the issue please @NitroBAY

@ilan-schemoul
Copy link
Owner

@Cholowao I think it may still happen like in other SW and if I take over this package again I may be trying to found a way around cache overflow

@ilan-schemoul
Copy link
Owner

Well spamming cache can push limit indefinitely it seems.
sw

@ilan-schemoul
Copy link
Owner

I'm wondering if the fact making the browser use 15gb of the memory is actual a security breach ? Maybe should I report it to Chrome ?

@santiagopuentep
Copy link

santiagopuentep commented Jun 18, 2018

I'm getting quota exceeded when storing cross origin responses. Chrome seems to put a padding on that kind of response and I'm in over 100 MB with just a few small svgs cached...

@AppXprt
Copy link

AppXprt commented Sep 17, 2018

This storage isn't RAM.. 5GB would imply service worker cache is being stored in local storage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants