Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to precache Firebase? #624

Closed
amalshehu opened this issue Jun 10, 2017 · 3 comments
Closed

How to precache Firebase? #624

amalshehu opened this issue Jun 10, 2017 · 3 comments
Labels
Needs More Info Waiting on additional information from the community.

Comments

@amalshehu
Copy link

amalshehu commented Jun 10, 2017

Library Affected:
workbox-sw, workbox-build, etc.

Browser & Platform:
Google Chrome v51.0.1 for Android, or "all browsers"

Issue or Feature Request Description:
How to precache Firebase?

When reporting bugs, please include relevant JavaScript Console logs and links to public URLs at which the issue could be reproduced.

@jeffposnick
Copy link
Contributor

What do you mean by "Firebase" in this context? Are you asking about the JavaScript library files, data from a Firebase datastore, or something else?

@jeffposnick jeffposnick added the Needs More Info Waiting on additional information from the community. label Jun 12, 2017
@amalshehu
Copy link
Author

Thanks for your response. I mean the data from firebase data store.

@jeffposnick
Copy link
Contributor

As of right now, the best approach would be to interact with Firebase via its REST API, and set up a runtime caching policy to cache the data.

The Firebase Realtime API uses websockets to communicate with the server, and websockets can't be intercepted by service workers.

Offline support for the Realtime API has been attempted via helper libraries that run outside the service worker; the most robust that I'm aware of uses https://github.com/PolymerElements/app-storage to mirror the Firebase data in IndexedDB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs More Info Waiting on additional information from the community.
Projects
None yet
Development

No branches or pull requests

2 participants