📅  最后修改于: 2022-03-11 14:54:21.853000             🧑  作者: Mango
getResponse();
$controller = $event->getRequest()->attributes->get('_controller');
$requiredAssetAction = "AppBundle\Controller\Website\AssetsController::assetAction";
if ($controller == $requiredAssetAction) {
$response->headers->addCacheControlDirective('max-age', 900);
$response->headers->addCacheControlDirective('s-maxage', 900);
$response->headers->addCacheControlDirective('must-revalidate', true);
$response->headers->addCacheControlDirective('public', true);
$response->headers->removeCacheControlDirective('private');
}
$event->setResponse($response);
}
}