Create the cache key for the current page and language
519397
def get_cache_key(page):
    
    try:
        site_id = page.node.site_id
    except AttributeError:
        site_id = page.site_id
    return _get_cache_key('page_sitemap', page, 'default', site_id)
1314305
def cache_set(site, key, data):
	''''''
	tkey = getkey(T_ITEM, site.id, key)
	mkey = getkey(T_META, site.id)
	tmp = cache.get(mkey)
	longdur = 365*24*60*60
	if not tmp:
		tmp = [tkey]
		cache.set(mkey, [tkey], longdur)
	elif tkey not in tmp:
		tmp.append(tkey)
		cache.set(mkey, tmp, longdur)
	cache.set(tkey, data, site.cache_duration)
734258
def cache_page(**kwargs):
    
    cache_timeout = kwargs.pop('cache_timeout', None)
    key_prefix = kwargs.pop('key_prefix', None)
    cache_min_age = kwargs.pop('cache_min_age', None)
    decorator = decorators.decorator_from_middleware_with_args(CacheMiddleware)(
        cache_timeout=cache_timeout,
        key_prefix=key_prefix,
        cache_min_age=cache_min_age,
        **kwargs
    )
    return decorator
1199603
def _build_cache_key(request):
        
        str_hash = md5(
            (request.method + request.url + str(request.params) + str(request.data) + str(request.json)).encode(
                'utf-8')).hexdigest()
        return 'esi_%s' % str_hash
624674
def _make_cache_key(key_prefix):
    
    if callable(key_prefix):
        cache_key = key_prefix()
    elif '%s' in key_prefix:
        cache_key = key_prefix % request.path
    else:
        cache_key = key_prefix

    cache_key = cache_key.encode('utf-8')

    return cache_key
328629
def get(self, lang, instance):
        
        instance_key = TransCache._create_key(lang, instance)
        return self.cache[instance_key]
608790
def cache_name(self):
        
        lang = get_language()
        cache = build_localized_fieldname(self.accessor, lang)
        return "_%s_cache" % cache
686284
public function cacheKey()
    {
        $this->cacheKey = $this->cacheKey ??
            $this->generateCacheKey(
                auth()->guest() ? 'guest' : auth()->user()->role
            );

        return $this->cacheKey;
    }
363383
public function addLocalizedPagesToCache($pageRow)
    {
        // create entry in cachedPageRecods for default language
        $this->cachedPageRecords[0][$pageRow['uid']] = $pageRow;

        // create entry in cachedPageRecods for additional languages, skip default language 0
        foreach ($this->sysLanguages as $sysLang) {
            if ($sysLang['uid'] > 0) {

                // check for unified page translation handling feature
                // see https://docs.typo3.org/typo3cms/extensions/core/Changelog/9.0/Breaking-82445-PagesAndPageTranslations.html
                if (GeneralUtility::makeInstance(Features::class)->isFeatureEnabled(
                    'unifiedPageTranslationHandling'
                )) {
                    $queryBuilder = Db::getQueryBuilder('pages');
                    list($pageOverlay) = $queryBuilder
                        ->select('*')
                        ->from('pages')
                        ->where(
                            $queryBuilder->expr()->eq(
                                'l10n_parent',
                                $queryBuilder->quote($pageRow['uid'], \PDO::PARAM_INT)
                            ),
                            $queryBuilder->expr()->eq(
                                'sys_language_uid',
                                $queryBuilder->quote($sysLang['uid'], \PDO::PARAM_INT)
                            )
                        )
                        ->execute()
                        ->fetchAll();
                } else {
                    // use fallback for translated pages in "pages_language_overlay"
                    $queryBuilder = Db::getQueryBuilder('pages_language_overlay');
                    list($pageOverlay) = $queryBuilder
                        ->select('*')
                        ->from('pages_language_overlay')
                        ->where(
                            $queryBuilder->expr()->eq(
                                'pid',
                                $queryBuilder->quote($pageRow['uid'], \PDO::PARAM_INT)
                            ),
                            $queryBuilder->expr()->eq(
                                'sys_language_uid',
                                $queryBuilder->quote($sysLang['uid'], \PDO::PARAM_INT)
                            )
                        )
                        ->execute()
                        ->fetchAll();
                }

                if ($pageOverlay) {
                    $this->cachedPageRecords[$sysLang['uid']][$pageRow['uid']] = $pageOverlay + $pageRow;
                }
            }
        }
    }
495981
def set(self, key, *args):
        """"""
        return self.cache.set(self._hashed(key), *args)
1247563
def set(self, key, response):
        """"""
        mod = response.headers.pop('last-modified', None)
        status = int(response.status_code)
        rec = (key, status, mod, response.encoding, response.content,
               json.dumps(dict(response.headers)))
        with self._conn:
            self._conn.execute("DELETE FROM cache WHERE key=?", (key, ))
            self._conn.execute("INSERT INTO cache VALUES (?,?,?,?,?,?)", rec)
1170055
static function storeCache( $key )
    {
        $translationCache = eZTranslationCache::cacheTable();
        if ( !isset( $translationCache[$key] ) )
        {
            eZDebug::writeWarning( "Translation cache for key '$key' does not exist, cannot store cache", __METHOD__ );
            return;
        }
        $internalCharset = eZTextCodec::internalCharset();
//         $cacheFileKey = "$key-$internalCharset";
        $cacheFileKey = $key;
        $cacheFileName = md5( $cacheFileKey ) . '.php';

        $cache =& $translationCache[$key];

        if ( !file_exists( eZTranslationCache::cacheDirectory() ) )
        {
            eZDir::mkdir( eZTranslationCache::cacheDirectory(), false, true );
        }
        $php = new eZPHPCreator( eZTranslationCache::cacheDirectory(), $cacheFileName );
        $php->addRawVariable( 'eZTranslationCacheCodeDate', self::CODE_DATE );
        $php->addSpace();
        $php->addRawVariable( 'CacheInfo', array( 'charset' => $internalCharset ) );
        $php->addRawVariable( 'TranslationInfo', $cache['info'] );
        $php->addSpace();
        $php->addRawVariable( 'TranslationRoot', $cache['root'] );
        $php->store( true );
    }
96287
def create_page(self, **extra_kwargs):
        
        with translation.override(self.default_language_code):
            # for evaluate the language name lazy translation
            # e.g.: settings.LANGUAGE_CODE is not "en"

            self.default_lang_name = dict(
                self.languages)[self.default_language_code]
            self.slug = self.get_slug(self.default_language_code,
                                      self.default_lang_name)
            assert self.slug != ""

        page = None
        parent = self.get_parent_page()
        if parent is not None:
            assert parent.publisher_is_draft == True, "Parent page '%s' must be a draft!" % parent

        if self.delete_first:
            if self.apphook_namespace is not None:
                pages = Page.objects.filter(
                    application_namespace=self.apphook_namespace,
                    parent=parent,
                )
            else:
                pages = Page.objects.filter(
                    title_set__slug=self.slug,
                    parent=parent,
                )
            log.debug("Delete %i pages...", pages.count())
            pages.delete()
        else:
            if self.apphook_namespace is not None:
                # Create a plugin page
                queryset = Page.objects.drafts()
                queryset = queryset.filter(parent=parent)
                try:
                    page = queryset.get(
                        application_namespace=self.apphook_namespace)
                except Page.DoesNotExist:
                    pass  # Create page
                else:
                    log.debug("Use existing page: %s", page)
                    created = False
                    return page, created
            else:
                # Not a plugin page
                queryset = Title.objects.filter(
                    language=self.default_language_code)
                queryset = queryset.filter(page__parent=parent)
                try:
                    title = queryset.filter(slug=self.slug).first()
                except Title.DoesNotExist:
                    pass  # Create page
                else:
                    if title is not None:
                        log.debug("Use page from title with slug %r",
                                  self.slug)
                        page = title.page
                        created = False

        if page is None:
            with translation.override(self.default_language_code):
                # set right translation language
                # for evaluate language name lazy translation
                # e.g.: settings.LANGUAGE_CODE is not "en"

                page = create_page(
                    title=self.get_title(self.default_language_code,
                                         self.default_lang_name),
                    menu_title=self.get_menu_title(self.default_language_code,
                                                   self.default_lang_name),
                    template=self.get_template(self.default_language_code,
                                               self.default_lang_name),
                    language=self.default_language_code,
                    slug=self.slug,
                    published=False,
                    parent=parent,
                    in_navigation=self.in_navigation,
                    apphook=self.apphook,
                    apphook_namespace=self.apphook_namespace,
                    **extra_kwargs)
                created = True
                log.debug("Page created in %s: %s", self.default_lang_name,
                          page)

        assert page.publisher_is_draft == True
        return page, created
233635
def get_placeholder_cache_key_for_parent(parent_object, placeholder_name, language_code):
    
    parent_type = ContentType.objects.get_for_model(parent_object)
    return _get_placeholder_cache_key_for_id(
        parent_type.id,
        parent_object.pk,
        placeholder_name,
        language_code
    )
1029640
def _create_cache_key(source_file):
        
        path, name = os.path.split(source_file)
        return name + str(hash(path))
1154911
def _build_cache_key(self, uri):
        
        key = uri.clone(ext=None, version=None)

        if six.PY3:
            key = key.encode('utf-8')

        return sha1(key).hexdigest()
206778
@Override
    public CacheKey getCacheKey(HttpServletRequest request, HttpServletResponse response) {
        final LocaleManager localeManager = this.getLocaleManager(request);

        final List<Locale> locales = localeManager.getLocales();
        if (locales != null && locales.size() > 0 && locales.get(0) != null) {
            final String locale = locales.get(0).toString();
            final String xslLocale = locale.replace('_', '-');
            return CacheKey.build(this.getClass().getName(), xslLocale);
        }

        return null;
    }