如果启用了持久性,那么当缓存中存在数据时,什么算作读操作? [英] If persistence is enabled, what counts as read operations when data exists in cache?

查看:36
本文介绍了如果启用了持久性,那么当缓存中存在数据时,什么算作读操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果收听者断开连接的时间超过30分钟(例如,如果用户离线),您将被收取阅读费用,就像您有发出了全新的查询.

If the listener is disconnected for more than 30 minutes (for example, if the user goes offline), you will be charged for reads as if you had issued a brand-new query.

如果启用了持久性,这是否仍然适用?

Does this still apply if persistence is enabled?

情况1:应用程序离线30分钟以上.持久性已启用,并从缓存中读取数据.从缓存中读取文档是否算作读取操作?

Situation 1: App is offline for over 30 minutes. Persistence is enabled and reads data from cache. Does reading documents from cache count as read operations?

情况2:应用在线,但未执行添加/修改/删除操作.启用了持久性,并且所有数据都存在于缓存中.如果没有添加/修改/删除新数据,在30分钟后打开我的应用是否会引起读取操作?

Situation 2: App is online but no added/modified/deleted operations occur. Persistence is enabled and all data exists in cache. Does opening my app after 30 minutes cause read operations if no new data has been added/modified/deleted?

Firestore文档

推荐答案

在两种情况下,如果某些读取操作仅由本地缓存满足,则不计入费用.

In both cases, if some read operation is satisfied only by the local cache, it is not billed.

您引用的有关侦听器的文档的问题专门涉及可能随时间返回多个文档的查询的总结果.请注意,查询侦听器可以随着时间的推移无限期地为新文档或更改的文档生成更新.但是,如果您的查询侦听器断开连接超过30分钟,则会再次为整个查询付费,并且不要继续使用侦听器先前可能会产生部分或正在进行的结果的地方.

The issue with the documentation that you quoted about listeners is specifically regarding the total results of a query that could return multiple documents over time. Note that a query listener can generate updates for new or changed documents indefinitely over time. But if your query listener is disconnected for more than 30 minutes, you are billed for the entire query again, and do not pick up where the listener may have left off previously with partial or in-progress results.

这篇关于如果启用了持久性,那么当缓存中存在数据时,什么算作读操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆