在我的数据中,我有4个集合,我尝试从中读取的集合具有这种结构
Collection -> Document -> field1, field2, field3
field1,field2和field3均为数组,其中1和2为空,3包含79个字符串。这是我用来从所有字段获取数据的功能。
exports.export = functions.https.onRequest((req, res) => {
res.set('Cache-Control', 'public, max-age=86400, s-maxage=86400');
db.collection('CollectionX').doc('DocumentX').get().then(snapshot => {
return res.json(200, snapshot.data());
}).catch(err => {
return res.json(500, err);
});
});
在网络浏览器中调用此函数时,即使已缓存该函数,我的读取也从26激增至400多个。26 was from an identical request made 12 hours prior.
为什么会这样?您根本不需要400次读取就可以访问该数据。为什么在请求时缓存了数据,为什么要访问数据?
编辑:读取仍在增加,目前为605。
现在是621
似乎已经停止在644。