CacheService allows you to access a cache for short term storage of data. This class lets you get a specific cache instance. Public caches are for things that are not dependent on which user is accessing your script. Private caches are for things which are user-specific, like settings or recent activity.
|Method||Return type||Brief description|
|Gets the private cache instance for the script.|
|Gets the public cache instance for the script.|
Gets the private cache instance for the script. Private caches are private to the current active user and script. They can be used to store information specific to that user.
// Gets a cache that is private to the current user var cache = CacheService.getPrivateCache();
Cache — a private cache instance
Gets the public cache instance for the script. Public caches are common to all users of the script. Use these to store information that is not specific to the current user.
// Gets a cache that is common to all users of the script var cache = CacheService.getPublicCache();
Cache — a public cache instance