简体   繁体   中英

How to disable firestore cache for specific document?

I'm using Firestore offline cache with timestamps to get only the latest documents from the server. When I load data for the first time it will get data in ascending order of timestamps. this practice saves me many documents reads.

But the problem is I'm using dynamic links in my app. when a user opens my app with a dynamic link it will get the appropriate document from the Firestore server and it saves in the cache by default. If there is no data for a particular collection in the users device and if the dynamic link data loads the latest timestamped document, then it affects my above Firestore reads optimization.

So I want to disable offline cache for the specific documents (loaded from the dynamic links). I had seen this offline persistence documentation but doesn't helped me.

Any solution to disable offline cache for a specific document in Firestore or Modify the cached document timestamp?

So I want to disable offline cache for the specific documents

That's currently not possible. You cannot disable the offline persistence only for some documents. It's the entire database (up to the configured cache size) or nothing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM