Storage persistence and eviction
A site can ask the browser to keep its data permanently; otherwise it can be evicted when disk is low.
In one line
Can ask the browser to keep its saved data when space runs low
A site can ask the browser to keep its data permanently; otherwise it can be evicted when disk is low.
navigator.storage.persist() asks for protected storage. Chrome grants it from engagement, bookmarks or install, Firefox asks the person. Best effort data is deleted least recently used first. storage.estimate() reveals quota, a coarse signal.
What it can and can't do
What the user does: Firefox may ask you to allow Store data in persistent storage. Other browsers decide quietly.
It can
- Ask for persistent storage
- Check whether it was granted
- Check how much space it has used and has left, roughly
It cannot
- Make the browser agree
- Stop you clearing site data yourself
- Keep data after a private window closes
How it differs between platforms: Firefox asks you. Chrome decides on its own. Safari decides on its own and supports it only in part.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 55 | 2016-12-01 | None |
| Edge | Supported | 79 | 2020-01-15 | None |
| Firefox | Supported | 57 | 2017-11-14 | None |
| Safari | Partial | 15.2 | 2021-12-13 | Grants conditional |
| Safari on iPhone | Partial | 15.2 | 2021-12-13 | None |
| Chrome on Android | Supported | 55 | 2016-12-06 | None |
| Samsung Internet | Supported | 6.0 | 2017-08-23 | None |
How a site asks for it
| API | navigator.storage.persist(), persisted(), estimate() |
| Browser compat keys | api.StorageManager.persistapi.StorageManager.estimate |
| How access is granted | prompt |
| What the user sees | Firefox shows a permission prompt, Chrome decides silently |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | No |
| How long it lasts | Persistent until cleared by the person. Best effort until eviction |
| How to take it back | Clear site data, browser privacy settings |
| Inside an iframe | Not listed |
Data you get
What comes back: Quota estimate and persisted flag
Shape: object
How often: any time
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
quota | integer | bytes | up to disk share | rounded |
Technical limits
- Chrome decides persist by heuristics with no prompt
- Firefox shows a prompt
- estimate() values are padded or rounded to resist fingerprinting
- Safari applies the 7 day cap except for installed web apps
The story
What it is
A site can ask the browser to keep its data for good. Otherwise low disk space can erase it.
For you
Most of the time nothing seems to happen. But if your device runs low on space, a site you rarely use may lose its offline data and ask you to log in or download again.
For makers
Makers want their data to survive, because a lost offline copy means a frustrated user. They request protection, and browsers grant it based on use. Trackers also like data that outlives clearing.
Where you see it
| Type | Example | Apps |
|---|---|---|
| games | A browser game asks to protect your saves so a low disk does not erase your progress. | None named |
| productivity | A note app asks to protect offline notes that are not yet synced to the cloud. | None named |
| creative | A web editor asks to protect a long project saved only on your device. | None named |
| media | A podcast or music app asks to keep your downloads. | None named |
| security | A browser clears old data first from sites you rarely visit, to free up space. | None named |
| ads | A tracker hides an ID in storage that the browser might never clear on its own. | None named |
Risks
- Data can vanish
- Lingering trackers
What the platform says
- web.dev: Persistent storage. Google explains how a site can ask the browser to protect its data from automatic cleanup.
- WebKit: Updates to storage policy. Apple explains how Safari handles storage limits and when it can clear a site's data.
Good uses and abuse
Legitimate uses
- Protecting offline data
Known abuse
- Ensuring tracker storage is not evicted
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 4 of 5 | How useful it is to honest apps |
| Friction | 1 of 5 | How much the user has to do |
| Fingerprint bits | 1 | Rough identifying entropy, when known |
History
- 2016-06, Chrome 55: Persistent storage shipped
- 2017-05, Firefox 57: StorageManager shipped
- 2022-03, Safari 15.2: navigator.storage.persist shipped
Related capabilities
Related
- IndexedDB. Can keep gigabytes of organized data for its own site in your browser
- Safari 7 day script storage deletion. Can't keep script saved data in Safari after 7 days of use without a visit
Sources
How well checked: Based on official documentation.