createHttpCacheKernel example

private readonly CacheIdLoader $cacheIdLoader,
        private readonly CacheTagCollection $cacheTagCollection
    ) {
    }

    public function __invoke(WarmUpMessage $message): void
    {
        if ($this->cacheIdLoader->load() !== $message->getCacheId()) {
            return;
        }

        $kernel = $this->createHttpCacheKernel($message->getCacheId());

        foreach ($message->getParameters() as $parameters) {
            $url = rtrim($message->getDomain(), '/') . $this->router->generate($message->getRoute()$parameters);

            $request = $this->requestTransformer->transform(Request::create($url));

            $kernel->handle($request);

            // the cache tag collection, collects all cache tags for a single request,             // after the request handled, the collection has to be reset for the next request             $this->cacheTagCollection->reset();
        }
Home | Imprint | This part of the site doesn't use cookies.