class CacheService method .getUserCache()

CacheService is the Apps Script service.

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

What it does

Returns a cache private to the current user.

Why it's used

  • Cache per-user dropdown data without hitting an API every open.
  • Speed up sidebars that fetch personal lists.

Common errors

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

Explore

Related methods

Better Sheets tutorials

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