KernelEvents::REQUEST => 'addHttpCacheToCoreRoutes',
KernelEvents::RESPONSE =>
[ ['setResponseCache', -1500
],
['setResponseCacheHeader', 1500
],
],
BeforeSendResponseEvent::
class => 'updateCacheControlForBrowser',
];
} public function addHttpCacheToCoreRoutes(RequestEvent
$event): void
{ $request =
$event->
getRequest();
$route =
$request->attributes->
get('_route'
);
if (\
in_array($route, self::CORE_HTTP_CACHED_ROUTES, true
)) { $request->attributes->
set(PlatformRequest::ATTRIBUTE_HTTP_CACHE, true
);
} } public function setResponseCache(ResponseEvent
$event): void
{ if (!
$this->httpCacheEnabled
) { return;
}