What is the storage limit for a service worker? What is the storage limit for a service worker? javascript javascript

What is the storage limit for a service worker?


Update Jan 15 2018

The StorageManager interface of Storage API is becoming a standard for all storage related api queries. As mentioned by @miguel-lattuada, the estimate API would provide an estimate of the storage used a web app the available storage. Also, note the QuotaExceededError exception which would help us in handling error scenarios.

eg code:

if ('storage' in navigator && 'estimate' in navigator.storage) {  navigator.storage.estimate().then(({usage, quota}) => {    console.log(`Using ${usage} out of ${quota} bytes.`);  }).catch(error => {    console.error('Loading storage estimate failed:');    console.log(error.stack);  });} else {  console.error('navigator.storage.estimate API unavailable.');}