private readonly AbstractCacheTracer
$tracer,
private readonly AbstractHttpCacheKeyGenerator
$cacheKeyGenerator,
private readonly MaintenanceModeResolver
$maintenanceResolver,
array
$sessionOptions ) { $this->sessionName =
$sessionOptions['name'
] ?? 'session-';
} public function lookup(Request
$request): ?Response
{ // maintenance mode active and current ip is whitelisted > disable caching
if (!
$this->maintenanceResolver->
shouldBeCached($request)) { return null;
} $key =
$this->cacheKeyGenerator->
generate($request);
$item =
$this->cache->
getItem($key);
if (!
$item->
isHit() || !
$item->
get()) { return null;
}