The cache key is a string of concatenated sorted names and values.
542143
def _get_cache_key(self):
        

        keys = list(self.params.keys())
        keys.sort()

        cache_key = str()

        for key in keys:
            if key != "api_sig" and key != "api_key" and key != "sk":
                cache_key += key + self.params[key]

        return hashlib.sha1(cache_key.encode("utf-8")).hexdigest()
1171958
public String calculateCacheKey(String sql, int[] columnIndexes) {
		StringBuilder tmp = new StringBuilder(sql.length()+4);
		tmp.append(sql);
		for (int i=0; i < columnIndexes.length; i++){
			tmp.append(columnIndexes[i]);
			tmp.append("CI,");
		}
		return tmp.toString();
	}
1153630
def many_from_cache(self, preferences):
        
        keys = {
            p: self.get_cache_key(p.section.name, p.name)
            for p in preferences
        }
        cached = self.cache.get_many(list(keys.values()))

        for k, v in cached.items():
            # we replace dummy cached values by None here, if needed
            if v == preferences_settings.CACHE_NONE_VALUE:
                cached[k] = None

        # we have to remap returned value since the underlying cached keys
        # are not usable for an end user
        return {
            p.identifier(): p.serializer.deserialize(cached[k])
            for p, k in keys.items()
            if k in cached
        }
391059
def cache_key(self, method_name):
        """"""
        key = ""
        method = getattr(self, "cache_key_{}".format(method_name), None)
        if method:
            key = method()

        return key
186012
private static String computeKeyHash(String memcachedPrefix, NamedKey key)
  {
    // hash keys to keep things under 250 characters for memcached
    return memcachedPrefix + ":" + DigestUtils.sha1Hex(key.namespace) + ":" + DigestUtils.sha1Hex(key.key);
  }
789376
function listCacheSet$1(key, value) {
  var data = this.__data__,
      index = assocIndexOf$4(data, key);

  if (index < 0) {
    ++this.size;
    data.push([key, value]);
  } else {
    data[index][1] = value;
  }
  return this;
}
382756
public static function getCombinerCacheKey()
    {
        $theme = CmsTheme::getActiveTheme();
        if (!$theme->hasCustomData()) {
            return '';
        }

        $customData = $theme->getCustomData();

        return (string) $customData->updated_at ?: '';
    }
20078
@Override
  public Iterable<K> keys() {
    return new Iterable<K>() {
      @Override
      public Iterator<K> iterator() {
        final Iterator<CacheEntry<K,V>> it = BaseCache.this.iterator();
        return new Iterator<K>() {
          @Override
          public boolean hasNext() {
            return it.hasNext();
          }

          @Override
          public K next() {
            return it.next().getKey();
          }

          @Override
          public void remove() {
            throw new UnsupportedOperationException();
          }
        };
      }
    };
  }
365779
def _get_cache_key(self, obj):
        """"""
        if obj is not None:
            # Make sure that key is REALLY unique.
            return '{}-{}'.format(id(self), obj.pk)

        return "{}-None".format(id(self))
1362601
private void cacheCodes() {
        Set<ProcCode> set = new HashSet<ProcCode>();

        if (parent != null) {
            set.addAll(Arrays.asList(parent.getCodes()));
        }

        if (scopeCodes != null) {
            set.addAll(scopeCodes);
        }

        cachedCodes = set.toArray(new ProcCode[set.size()]);
        Arrays.sort(
                cachedCodes,
                new Comparator<ProcCode>() {
                    public int compare(ProcCode code1, ProcCode code2) {
                        return code2.compareTo(code1);
                    }
                }
        );

        for (ProcCode code : cachedCodes) {
            hasCrazyCode = hasCrazyCode || !code.startsWithConstant();
            hasCheck = hasCheck || code.containsCheck();
        }
    }
1259225
private void put(T item) {
        HashMap<String,Object> keys;

        if( item == null ) {
            throw new NullPointerException("Multi caches may not have null values.");
        }
        keys = getKeys(item);
        synchronized( this ) {
            for( String key : caches.keySet() ) {
                ConcurrentCache<Object,T> cache = caches.get(key);
                Object ob = keys.get(key);

                if( ob instanceof BigDecimal ) {
                    ob = ((BigDecimal)ob).longValue();
                }
                cache.put(ob, item);
            }
        }
    }
714454
def _get_cache_key(self, args, kwargs):
        
        hash_input = json.dumps({'name': self.name, 'args': args, 'kwargs': kwargs}, sort_keys=True)
        # md5 is used for internal caching, not need to care about security
        return hashlib.md5(hash_input).hexdigest()
616434
def _cache_key(cmd_id):
        """"""
        return '{}__{}__{}__{}'.format(
            cmd_id.generationTime, cmd_id.origin, cmd_id.sequenceNumber,
            cmd_id.commandName)
17589
function _cacheData(key, value) {
    cache[key] = { timeStamp: _getTimeStamp(), value: value };
    _deletePromiseWaiting(key);
    return value;
}
289108
function _prepareKeys(template, key) {
  return [].concat.apply([], _checkBraces(key).map(function (k) {
    return _checkEach(template, k);
  }));
}
1102740
def keys(self):
        """"""

        keys = OrderedDict()

        def order_key(_):
            (k, v) = _
            cache_key = getattr(type(self), k)
            return cache_key.order

        items = [(k, getattr(type(self), k)) for k
            in dir(type(self))
        ]
        items = [(k, v) for (k, v)
            in items
            if isinstance(v, Key)
        ]

        for k, v in sorted(items, key=order_key):
            keys[k] = getattr(self, k)
        return keys
1320000
function cacheKey () {
    //  get cache id
    var cacheId = stableId({
        args: this.query.args,
        columnsId: this.cache.model.columnsId,
    })
    // create cache key
    return `${this.cache.model.name}:view:select:collection:${cacheId}`
}