class CacheService method .getScriptCache()

CacheService is the Apps Script service.

.getScriptCache() is the method name you will see after a dot in your code.

What it does

Returns a cache shared by all users of the script.

Why it's used

  • Share cached API results across all users of the add-on.
  • Cut duplicate calls to slow external services.

Common errors

  • Forgetting parentheses on getScriptCache. Write CacheService.getScriptCache(), not CacheService.getScriptCache or getScriptCache by itself.
  • Skipping dots between chained calls. Each step needs a dot, like CacheService.getScriptCache().
  • Adding spaces where they do not belong. Write CacheService.getScriptCache(), not CacheService .getScriptCache(), CacheService.getScriptCache (), or CacheService . getScriptCache().
  • Wrong capitalization. Use CacheService and getScriptCache, not cacheservice or getscriptcache.

Explore

Related methods

Better Sheets tutorials

No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.