If the given key is a string containing alphanumeric characters only and no more than 32 characters,
then the key will be returned back prefixed with [[keyPrefix]]. Otherwise, a normalized key
is generated by serializing the given key, applying MD5 hashing, and prefixing with [[keyPrefix]].
/** * Builds a normalized cache key from a given key. * * This will baypass if the we don't want to normalize the key. * * @param mixed $key the key to be normalized * @return string the generated cache key */ public function buildKey($key) { if (!is_string($key) || $this->hashKey) { return parent::buildKey($key); } return $this->keyPrefix . $key; }
/** * @param mixed $key * * @return string * * @see yii\caching\Cache::buildKey() */ public function buildKey($key) { return $this->cache->buildKey($key); }