[英]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.我正在制作一个聊天应用程序,我希望 Firebase Firestore 数据库仅缓存由我或为我发送的消息。 How can I do this?
我怎样才能做到这一点? Can I control what documents are cached in Firestore database?
我可以控制在 Firestore 数据库中缓存哪些文档吗? Thanks.
谢谢。
The Firestore SDK provides no direct control over the cache, other than its total size, and whether or not it's active. Firestore SDK 不提供对缓存的直接控制,除了其总大小以及它是否处于活动状态。 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.一种替代方法是仅使用 SDK 读取应缓存的文档,并使用REST API进行所有其他不应缓存的读取。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.