Skip to content

Commit

Permalink
Set CustomTtlListener cache life time
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Jul 22, 2024
1 parent f09b49a commit bc3874c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/Functional/Fixtures/Symfony/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,29 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ
case '/cache':
$response = new Response(microtime(true));
$response->setCache(['max_age' => 3600, 'public' => true]);
$response->headers->set('X-Reverse-Proxy-TTL', '3600');

return $response;
case '/tags':
$response = new Response(microtime(true));
$response->setCache(['max_age' => 3600, 'public' => true]);
$response->headers->set('X-Cache-Tags', 'tag1,tag2');
$response->headers->set('X-Reverse-Proxy-TTL', '3600');

return $response;
case '/tags_multi_header':
$response = new Response(microtime(true));
$response->setCache(['max_age' => 3600, 'public' => true]);
$response->headers->set('X-Cache-Tags', ['tag1', 'tag2']);
$response->headers->set('X-Reverse-Proxy-TTL', '3600');

return $response;
case '/negotiation':
$response = new Response(microtime(true));
$response->setCache(['max_age' => 3600, 'public' => true]);
$response->headers->set('Content-Type', $request->headers->get('Accept'));
$response->setVary('Accept');
$response->headers->set('X-Reverse-Proxy-TTL', '3600');

return $response;
}
Expand Down

0 comments on commit bc3874c

Please sign in to comment.