Storage
Published
Storage determines how much a PWA can keep on device, how durable it is, and how it survives storage pressure. Offline-capable apps depend on it: Cache Storage holds the app shell and assets, IndexedDB holds structured data, and the StorageManager API governs quota and persistence.
These entries cover how much you get, how to make it persistent, what gets evicted, and how cross-site storage access works.
In this section
Section titled “In this section”Persistence, quotas, and evictionStorageManager estimate() and persist(), best-effort vs persistent storage, how browsers grant it, and what gets evicted.
Clearing site dataThe Clear-Site-Data response header — cache, cookies, storage, and speculation-rules directives for logout flows.
Cache Storage: the request/response store behind offline PWAsHow the Cache Storage API stores Request/Response pairs for offline-capable PWAs — the CacheStorage and Cache interfaces, where it runs, how it differs from the HTTP cache, and the practical rules for versioning and cleanup.
Eviction and best-effort vs persistent storageHow browsers classify per-origin storage as best-effort or persistent, the least-recently-used order they evict best-effort origins in under storage pressure, and why eviction always clears a whole storage bucket at once.
IndexedDB: structured client-side storage for PWAsHow IndexedDB stores structured data and large blobs in the browser — object stores, indexes, transactions, the asynchronous request model, versioned schema upgrades, and why most apps reach for a wrapper.
localStorage and sessionStorageHow localStorage and sessionStorage differ, their same-origin and per-origin quota rules, and why private-browsing behavior actually varies by browser.
Origin Private File System (OPFS)How navigator.storage.getDirectory() exposes a per-origin, user-invisible file storage endpoint, the synchronous FileSystemSyncAccessHandle methods available only inside dedicated Web Workers, and the Baseline-widely-available-since-March-2023 browser support.
CHIPS: partitioned third-party cookies, explainedSet-Cookie: Partitioned gives a third-party cookie its own jar per top-level site. What CHIPS changes, how to set it, and where it is supported.
Quotas and StorageManager.estimate()What navigator.storage.estimate() reports, how browsers compute the per-origin quota, why the numbers are deliberately imprecise, and how to budget storage and handle QuotaExceededError.
Storage Access API: third-party cookies in iframesHow hasStorageAccess() and requestStorageAccess() let embedded cross-site content reach third-party cookies browsers block by default, and the gesture required.
← Back to the Reference overview.