setCacheIdHeader example

$this->response->headers->set('cache-control', 'public, max-age=' . $cacheTime . ', s-maxage=' . $cacheTime, true);

        $noCacheTags = $cacheControl->getNoCacheTagsForRequest($this->request, $shopId);
        if (!empty($noCacheTags)) {
            $this->response->headers->set('x-shopware-allow-nocache', implode(', ', $noCacheTags), true);
        }

        $cacheCollector = $this->get('http_cache.cache_id_collector');

        $context = $this->get(ContextServiceInterface::class)->getShopContext();

        $this->setCacheIdHeader(
            $cacheCollector->getCacheIdsFromController($this->action, $context)
        );

        return true;
    }

    /** * This method sets the nocache-cookie if actions in the shop are triggered * * @return void */
    
Home | Imprint | This part of the site doesn't use cookies.