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?
CodePudding user response:
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.