Skip to Content
Platform.Ontology

Storage persistence and eviction

A site can ask the browser to keep its data permanently; otherwise it can be evicted when disk is low.

Works without askingFiles and storageAfter leavingWeb browsersAfter you leave the siteWhile you use it

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

BrowserStatusFirst versionReleasedNote
ChromeSupported552016-12-01None
EdgeSupported792020-01-15None
FirefoxSupported572017-11-14None
SafariPartial15.22021-12-13Grants conditional
Safari on iPhonePartial15.22021-12-13None
Chrome on AndroidSupported552016-12-06None
Samsung InternetSupported6.02017-08-23None

How a site asks for it

APInavigator.storage.persist(), persisted(), estimate()
Browser compat keysapi.StorageManager.persist
api.StorageManager.estimate
How access is grantedprompt
What the user seesFirefox shows a permission prompt, Chrome decides silently
Needs a secure context (HTTPS)Yes
Needs a user gestureNo
How long it lastsPersistent until cleared by the person. Best effort until eviction
How to take it backClear site data, browser privacy settings
Inside an iframeNot listed

Data you get

What comes back: Quota estimate and persisted flag
Shape: object
How often: any time

FieldTypeUnitRangePrecision
quotaintegerbytesup to disk sharerounded

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

TypeExampleApps
gamesA browser game asks to protect your saves so a low disk does not erase your progress.None named
productivityA note app asks to protect offline notes that are not yet synced to the cloud.None named
creativeA web editor asks to protect a long project saved only on your device.None named
mediaA podcast or music app asks to keep your downloads.None named
securityA browser clears old data first from sites you rarely visit, to free up space.None named
adsA 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

Good uses and abuse

Legitimate uses

  • Protecting offline data

Known abuse

  • Ensuring tracker storage is not evicted

Scores

ScoreValueMeaning
Sensitivity2 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction1 of 5How much the user has to do
Fingerprint bits1Rough 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

Sources

How well checked: Based on official documentation.

On this page