code: function(key, value) {
            if (capacity < Number.MAX_VALUE) {
              var lruEntry = lruHash[key] || (lruHash[key] = {key: key});
  
              refresh(lruEntry);
            }
  
            if (isUndefined(value)) return;
            if (!(key in data)) size++;
            data[key] = value;
  
            if (size > capacity) {
              this.remove(staleEnd.key);
            }
  
            return value;
          }
docs: @ngdoc method
  @name $cacheFactory.Cache#put
  @kind function
  
  @description
  Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be
  retrieved later, and incrementing the size of the cache if the key was not already
  present in the cache. If behaving like an LRU cache, it will also remove stale
  entries from the set.
  
  It will not insert undefined values into the cache.
  
  @param {string} key the key under which the cached data is stored.
  @param {*} value the value to store alongside the key. If it is undefined, the key
  will not be stored.
  @returns {*} the value stored.