CategoryRouteCacheKeyEvent example

return CacheValueCompressor::compress($response);
            });

            return CacheValueCompressor::uncompress($value);
        });
    }

    private function generateKey(string $navigationId, Request $request, SalesChannelContext $context): ?string
    {
        $parts = [...$request->query->all(), ...$request->request->all(), ...[$this->generator->getSalesChannelContextHash($context[RuleAreas::CATEGORY_AREA, RuleAreas::PRODUCT_AREA])]];

        $event = new CategoryRouteCacheKeyEvent($navigationId$parts$request$context, null);
        $this->dispatcher->dispatch($event);

        if (!$event->shouldCache()) {
            return null;
        }

        return self::buildName($navigationId) . '-' . md5(Json::encode($event->getParts()));
    }

    /** * @return array<string> */
Home | Imprint | This part of the site doesn't use cookies.