ProductSuggestRouteCacheKeyEvent example

return CacheValueCompressor::uncompress($value);
    }

    private function generateKey(Request $request, SalesChannelContext $context, Criteria $criteria): ?string
    {
        $parts = [
            $this->generator->getCriteriaHash($criteria),
            $this->generator->getSalesChannelContextHash($context[RuleAreas::PRODUCT_AREA]),
            $request->get('search'),
        ];

        $event = new ProductSuggestRouteCacheKeyEvent($parts$request$context$criteria);
        $this->dispatcher->dispatch($event);

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

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

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