CacheService 使用 GAS 提供的缓存大小是多少 [英] What is the size of the cache provided by CacheService using GAS

查看:9
本文介绍了CacheService 使用 GAS 提供的缓存大小是多少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CacheService 的最大大小是多少?

What is the maximum size of the CacheService ?

我知道某些东西可以存储在缓存中的最长时间是 21600 秒,但我找不到 publicCache 和 privateCache 的大小实际上有多大,以及我们如何找出有多少空间 (stll) 可用缓存.

I know the maximum time something can be stored in cache is 21600 seconds, but I can't find how large the sizes of the publicCache and the privateCache actually are and how we can findout how much space (stll) is available in cache.

由于无法刷新缓存(请参阅如何刷新缓存) 并且似乎无法从缓存中检索所有键(以便从缓存中删除所有对象),我认为我要求的信息类型很重要.

As the cache can't be flushed (see How to flush the cache) and there seems to be no way retrieving all keys from the cache (in order to delete all objects from the cache), I think the kind of info I'm asking for is important.

最好(当然)提供有关缓存大小、键和允许刷新的信息.

Best would be (of course) to provide info about cachesize, keys and allow flushing.

推荐答案

如前所述,CacheService 大小未记录.每个键最多可存储 100KB 的数据量,但也可以使用多个键.在一项实验中,使用多个密钥存储了价值 10MB 的数据.由于执行超时,已达到此限制,因此可能会有更多限制.

As mentioned the CacheService size is undocumented. There is a 100KB maximum amount of data stored per key but multiple keys are possible. In an experiment 10MB worth of data was stored using multiple keys. This limit was hit due to execution timeout so more may be possible.

你可能想看看这个社区开发的 CacheHandler 库 如果您希望使用 CacheService 来存储大量临时数据.

You may want to look at this community developed CacheHandler library if you are anticipating on using CacheService for a lot of temporary data storage.

这篇关于CacheService 使用 GAS 提供的缓存大小是多少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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