简体   繁体   中英

How to cache only selected documents in Firebase Firestore in JavaScript SDK

I'm making a chat app and I want Firebase Firestore database to cache only that messages which are sent by me or for me. How can I do this? Can I control what documents are cached in Firestore database? Thanks.

The Firestore SDK provides no direct control over the cache, other than its total size, and whether or not it's active. The documentation describes everything you can do.

One alternative is to only use the SDK to read documents that should be cached, and use the REST API for all other reads that should not be cached.

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