Google Apps Script API
    Preparing search index...

    A reference to a particular cache.

    This class allows you to insert, retrieve, and remove items from a cache. This can be particularly useful when you want frequent access to an expensive or slow resource. For example, say you have an RSS feed at example.com that takes 20 seconds to fetch, but you want to speed up access on an average request.

    function getRssFeed() {
      var cache = CacheService.getScriptCache();
      var cached = cache.get("rss-feed-contents");
      if (cached != null) {
        return cached;
      }
      var result = UrlFetchApp.fetch("http://example.com/my-slow-rss-feed.xml"); // takes 20 seconds
      var contents = result.getContentText();
      cache.put("rss-feed-contents", contents, 1500); // cache for 25 minutes
      return contents;
    }
    
    interface Cache {
        get(key: string): string;
        getAll(keys: string[]): { [key: string]: any };
        put(key: string, value: string): void;
        put(key: string, value: string, expirationInSeconds: number): void;
        putAll(values: { [key: string]: any }): void;
        putAll(values: { [key: string]: any }, expirationInSeconds: number): void;
        remove(key: string): void;
        removeAll(keys: string[]): void;
    }
    Index

    Methods