class CacheService method .remove()

CacheService is the Apps Script service.

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

What it does

Deletes a cached value by key.

Why it's used

  • Invalidate stale cache after settings change.
  • Force a fresh pull on the next run.

Common errors

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

Explore

Related methods

Better Sheets tutorials

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