Thursday, 11 May 2017

Retrieving images from Firebase storage and storing them for offline use

Scenario:

I have a device running an expressJS app and a mongoDB instance. The app connects to a firebase database, syncs it to its mongoDB to allow for offline use and retrieved data is displayed (the users can't modify the data).

The firebase database is modified using another webapp.

At the moment, the data in the database is text. I want to add images as well and I'm planning to use Firebase cloud storage.

How do I make the images available for offline use?

Some ideas:

  1. Store the images in the device's browser localStorage
  2. Sync a local folder to the cloud storage
  3. Use caching on the Node server


via Danilo