Back to MemcachedStorage class

Method _getCacheId

protected string
_getCacheId
(mixed $id, mixed $group)
Get a cache_id string from an id/group pair
Parameters
  • string $id The cache data id
  • string $group The cache data group
Returns
  • string The cache_id string
Since
  • 1.7.0

Method _getCacheId - Source code

/**
 * Get a cache_id string from an id/group pair
 *
 * @param   string  $id     The cache data id
 * @param   string  $group  The cache data group
 *
 * @return  string   The cache_id string
 *
 * @since   1.7.0
 */
protected function _getCacheId($id, $group)
{
    $prefix = Cache::getPlatformPrefix();
    $length = \strlen($prefix);
    $cache_id = parent::_getCacheId($id, $group);
    if ($length) {
        // Memcached use suffix instead of prefix
        $cache_id = substr($cache_id, $length) . strrev($prefix);
    }
    return $cache_id;
}