Skip to content

Commit

Permalink
Make sure cache control headers are set.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsegura authored and tobias-93 committed Jul 4, 2023
1 parent 0398dbd commit fd1ad1c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Util/CacheControlConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace FOS\JsRoutingBundle\Util;

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\EventListener\AbstractSessionListener;

class CacheControlConfig
{
Expand All @@ -27,6 +28,8 @@ public function apply(Response $response): void
return;
}

$response->headers->set(AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER, 'true');

$this->parameters['public'] ? $response->setPublic() : $response->setPrivate();

if (is_int($this->parameters['maxage'])) {
Expand Down

0 comments on commit fd1ad1c

Please sign in to comment.