Advanced offline caching techniques in Cloud Firestore

Firebase · 21K views · 2022 · 12:34

Open on YouTube

Databases & storageWeb developmenttalkdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering or asking about Firestore offline persistence and using the local cache to cut latency and billed reads, often alongside Firestore bundles.

Recommended by 1 people across 1 different months, 2022 to 2023.

What it is

A 12-minute Firebase Summit 2022 session by Mark Duckworth on how the Cloud Firestore SDK cache works. It covers how caching cuts latency, supports offline queries and writes, and reduces billed document reads, plus strategies for using the cache well in an app.

What people said

Recommends Renaud Tarnec · 2022-12 · Stack Overflow · on “Filling indexedDb with data, so you don't need to make a second request using Firestore”

"every user might open an application/tab in browser few times in a day, and it will make double fetch on server" => Yes, the browser storage used by the persistence mechanism is attached to the browser and the device. Note that if the data you want to cache is infrequently changed (e.g. reference data, e.g. a list of products) you could take advantage of Cloud Firestore bundles [LINK] (Watch also this video [this video] ).

Cites Chaddeus · 2022-11 · Stack Overflow · on “Request permission to use offline persistence (web) with Firebase Firestore?”

I am working on a major update to my app and I wanted to take advantage of Firestore's offline persistence (web) as a caching layer (as described in this recent Firebase video: [this video] ). I have a tester who swears she has no security-related extensions installed. Or even any sort of third-party app meant to 'harden' a device. But my app's offline persistence does not work for her... and only her, out of about 20 testers. In Chrome she sees a message " Audit usage of navigator.useragent navigator.appversion and navigator.platform " in her console (but hasn't toggled the triangle to see if there is more info). In Edge she sees " tracking prevention blocked access to storage for... " and that

Cites glowbo · 2023-08 · Stack Overflow · on “How can I update cached data when server data is updated in firestore?”

Thank you! I think I got mislead by this [this video] video. They talk about caching as a reliable way to serve data without incurring in billed reads, if the database doesn't change too much.