Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
892 views
in Technique[技术] by (71.8m points)

google apps script - What is the size of the cache provided by CacheService using GAS

What is the maximum size of the CacheService ?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...