adriancarriger / angularfire2-offline

🔌 A simple wrapper for AngularFire2 to read and write to Firebase while offline, even after a complete refresh.
https://angularfire2-offline.firebaseapp.com/
MIT License
207 stars 48 forks source link

Offline cache didn't work firebase images (storage) #75

Closed mumairofficial closed 6 years ago

mumairofficial commented 6 years ago

I was wondering if this plugin supports the firebase storage images. I have stored images on firebase storage bucket which I download via link embedded in database records, is there any way to handle this scenario

larssn commented 6 years ago

It doesn't support it.

But your best bet would be to enable caching headers for firebase storage. Check out: https://firebase.google.com/docs/reference/js/firebase.storage.SettableMetadata#cacheControl

It would offload the caching responsibility to the webview. Not sure if it would work in a pure offline sense (try it), but we're using it in a chat-app to get images to simply load faster, because they don't have to be redownloaded.

rtm commented 6 years ago

One immediately thinks of trying to use service workers, but unfortunately they don't seem to play well with Cordova, which is my environment.