[英]How do you delete queried data from firebase locally?
In my react native app, users are able to create and see posts (that can contain media) which are stored in Firebase's realtime database.在我的 react native 应用程序中,用户可以创建和查看存储在 Firebase 实时数据库中的帖子(可以包含媒体)。 It works correctly, however the size of the app increases greatly over time, which I assume is because more and more posts are queried and stored.它可以正常工作,但是随着时间的推移,应用程序的大小会大大增加,我认为这是因为越来越多的帖子被查询和存储。 Is this likely to be what causes the increased size of the app?这可能是导致应用程序大小增加的原因吗? If so, is it possible to delete such local data in the componentDidMount
function?如果是这样,是否可以删除componentDidMount
function中的此类本地数据?
There is no API to tell Firebase to clear its cache.没有 API 告诉 Firebase 清除其缓存。 But if you find that the size of the cache grows beyond what is reasonable for your app, you can explicitly set the cache size to something that works better for your users.但是,如果您发现缓存的大小超出了您的应用程序的合理范围,您可以明确地将缓存大小设置为更适合您的用户的大小。
A few notes:几点注意事项:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.