Browsers give each site (each origin) a storage quota, shared by IndexedDB, the Cache API, OPFS and service worker registrations. Here is how it works in 2026.
How much?
| Browser | Approximate quota per origin |
|---|---|
| Chrome and Edge | Up to about 60% of total disk size |
| Firefox | Up to about 10% of disk (or 10 GiB) in best-effort mode; up to 50% (8 TiB cap) when persistent |
| Safari | Around 60% of disk for browser apps and Home Screen web apps; less for embedded views |
These change between versions, so always ask the browser rather than assuming.
const { usage, quota } = await navigator.storage.estimate();
console.log(`Using ${(usage / 1e6).toFixed(1)} MB of ${(quota / 1e9).toFixed(1)} GB`);
Try it on your own device with the storage inspector.
Best-effort vs persistent
By default, storage is best-effort: when the device runs low on space, the browser may delete it, least recently used origins first. You can ask for persistent storage, which is only cleared by the user:
if (navigator.storage?.persist) {
const persisted = await navigator.storage.persisted() || await navigator.storage.persist();
console.log(persisted ? 'Storage is persistent' : 'Storage may be cleared');
}
- Chrome and Edge grant it automatically when the site is installed, bookmarked, has notification permission or is used a lot. No prompt.
- Firefox asks the user.
- Safari (17 and later) decides from how the site is used, without a prompt; Home Screen web apps are the most likely to get it.
Safari's seven-day rule
Safari's Intelligent Tracking Prevention deletes script-writable storage (IndexedDB, Cache API, localStorage, service worker registrations) for sites the user has not interacted with in seven days of browser use. Home Screen web apps are exempt: their storage is separate and is not subject to this rule. This is one more reason to encourage installation on iOS.
Handling quota errors
Writes can fail with a QuotaExceededError. Catch it, clear old caches, and tell the user if needed:
try {
await cache.put(request, response);
} catch (err) {
if (err.name === 'QuotaExceededError') await trimCaches();
}
Good habits
- Cap runtime caches by count and age.
- Do not cache opaque cross-origin responses unless necessary (they are padded to several MB each in Chrome's quota accounting).
- Store large files in OPFS rather than as base64 strings.
- Offer a "Clear offline data" button in your settings.
Browser support
| Feature | Chrome / Edge desktop | Chrome Android | Safari iOS / iPadOS | Safari macOS | Firefox desktop | Firefox Android | Samsung Internet |
|---|---|---|---|---|---|---|---|
| Persistent storage | Chrome / Edge desktop: Yes | Chrome Android: Yes | Safari iOS / iPadOS: Yes (Safari 17+, decided by usage) | Safari macOS: Yes (Safari 17+) | Firefox desktop: Yes (Asks the user) | Firefox Android: Yes | Samsung Internet: Yes |
| Origin Private File System | Chrome / Edge desktop: Yes | Chrome Android: Yes | Safari iOS / iPadOS: Yes | Safari macOS: Yes | Firefox desktop: Yes | Firefox Android: Yes | Samsung Internet: Yes |
| IndexedDB | Chrome / Edge desktop: Yes | Chrome Android: Yes | Safari iOS / iPadOS: Yes | Safari macOS: Yes | Firefox desktop: Yes | Firefox Android: Yes | Samsung Internet: Yes |