Search code examples
firebasebrowserweb-applicationsprogressive-web-appsoffline-caching

How much can a Firebase PWA store offline (multimedia files)?


I'm looking to build a PWA for offline view of videos and music. I would like to store about (at least) 200-500 MB of data? Is this possible? Having read about browser quotas, i got confused. I'm talking about a normal android device of about 32 to 64 GB of internal storage.

And does this data expire? And can this data be accessible through normal file managers? The Native file system API do satisfy my needs but isn't it still in draft?


Solution

  • You can use Cloud Firestore and store your videos as firebase.firestore.Blob. You can enable offlinePersistance and these documents will be available even offline (you need to access them once though to download them).

    Firestore creates an IndexedDb for you out of the box. You can set a specific threshold (default 40MB), if you pass that limit, Firestore will prune older documents. The benefit of this approach is that you can build a proof of concept and try it in a matter of an hour.