cacheTile( options ) {
            $.console.assert( options, "[TileCache.cacheTile] options is required" );
            const theTile = options.tile;
            $.console.assert( theTile, "[TileCache.cacheTile] options.tile is required" );
            $.console.assert( theTile.cacheKey, "[TileCache.cacheTile] options.tile.cacheKey is required" );

            if (options.image instanceof Image) {
                $.console.warn("[TileCache.cacheTile] options.image is deprecated!" );
                options.data = options.image;
                options.dataType = "image";
            }

            let cacheKey = options.cacheKey || theTile.cacheKey;

            let cacheRecord = this._cachesLoaded[cacheKey];
            if (!cacheRecord) {
                if (options.data === undefined) {
                    $.console.error("[TileCache.cacheTile] options.image was renamed to options.data. '.image' attribute " +
                        "has been deprecated and will be removed in the future.");
                    options.data = options.image;
                }

                cacheRecord = this._zombiesLoaded[cacheKey];
                if (cacheRecord) {
                    // zombies should not be (yet) destroyed, but if we encounter one...
                    if (cacheRecord._destroyed) {
                        // if destroyed, invalidation routine will get triggered for us automatically
                        cacheRecord.revive();
                    } else {
                        // if zombie ready, do not overwrite its data, in that case try to call
                        // we need to trigger invalidation routine, data was not part of the system!
                        if (typeof data === 'function') {
                            options.data();
                        }
                        delete options.data;
                    }
                    delete this._zombiesLoaded[cacheKey];
                    this._zombiesLoadedCount--;
                    this._cachesLoaded[cacheKey] = cacheRecord;
                    this._cachesLoadedCount++;
                } else {
                    //allow anything but undefined, null, false (other values mean the data was set, for example '0')
                    const validData = options.data !== undefined && options.data !== null && options.data !== false;
                    $.console.assert( validData, "[TileCache.cacheTile] options.data is required to create an CacheRecord" );
                    cacheRecord = this._cachesLoaded[cacheKey] = new $.CacheRecord();
                    this._cachesLoadedCount++;
                }
            }

            if (!options.dataType) {
                $.console.error("[TileCache.cacheTile] options.dataType is newly required. " +
                    "For easier use of the cache system, use the tile instance API.");

                // We need to force data acquisition now to guess the type
                if (typeof options.data === 'function') {
                    $.console.error("[TileCache.cacheTile] options.dataType is mandatory " +
                        " when data item is a callback!");
                }
                options.dataType = $.converter.guessType(options.data);
            }

            cacheRecord.addTile(theTile, options.data, options.dataType);
            this._freeOldRecordRoutine(theTile, options.cutoff || 0);
            return cacheRecord;
        }
Caches the specified tile, removing an old tile if necessary to stay under the
maxImageCacheCount specified on construction. Note that if multiple tiles reference
the same image, there may be more tiles than maxImageCacheCount; the goal is to keep
the number of images below that number. Note, as well, that even the number of images
may temporarily surpass that number, but should eventually come back down to the max specified.
@private
@param {Object} options - Cache creation parameters.
@param {OpenSeadragon.Tile} options.tile - The tile to cache.
@param {?String} [options.cacheKey=undefined] - Cache Key to use. Defaults to options.tile.cacheKey
@param {String} options.tile.cacheKey - The unique key used to identify this tile in the cache.
  Used if options.cacheKey not set.
@param {Image} options.image - The image of the tile to cache. Deprecated.
@param {*} options.data - The data of the tile to cache. If `typeof data === 'function'` holds,
  the data is called to obtain the data item: this is an optimization to load data only when necessary.
@param {string} [options.dataType] - The data type of the tile to cache. Required.
@param {Number} [options.cutoff=0] - If adding this tile goes over the cache max count, this
  function will release an old tile. The cutoff option specifies a tile level at or below which
  tiles will not be released.
@returns {OpenSeadragon.CacheRecord} - The cache record the tile was attached to.