javascript - What is the storage limit for a service worker? -
most of browsers provide localstorage storage limit of 5mb per domain. there such memory limits/constraints respect service workers?
i know web workers (on service workers based) don't have such limitations. web workers not used assets caching, instead they're used more processing (so cpu main concern there).
if there's no limit on memory size, badly designed website crash browser?
recently came across article: offline-cookbook states below:
your origin given amount of free space wants with. free space shared between origin storage: localstorage, indexeddb, filesystem, , of course caches.
the amount isn't spec'd, differ depending on device , storage conditions. can find out how you've got via:
navigator.storagequota.queryinfo("temporary").then(function(info) { console.log(info.quota); // result: <quota in bytes> console.log(info.usage); // result: <used data in bytes> }); the above code might not work in browsers. (for eg: in chrome<48 1 might have webkitpersistentstorage etc)
other useful info/resources
as per offline storage progressive web apps addy osmani
in
chrome , opera: storage per origin (rather per api). both storage mechanisms store data until browser quota reached. apps can check how quota they’re using quota management api (as described above).firefoxno limits, prompt after 50mb data storedmobile safari50mb maxdesktop safariunlimited (prompts after 5mb)ie10+maxes @ 250mb , prompts @ 10mba more detailed guide on working quota on mobile browsers eiji kitamura.
for these relevant articles/solutions found problem. if knows better article or specifications please share.
Comments
Post a Comment