From 13febfb42effec9638d55db20434b3645f6314a2 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 18 Dec 2018 09:45:36 +0100 Subject: [PATCH] Updated comment for storeRelativeAgeDirective method --- .../HttpKernel/HttpCache/ResponseCacheStrategy.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpKernel/HttpCache/ResponseCacheStrategy.php b/src/Symfony/Component/HttpKernel/HttpCache/ResponseCacheStrategy.php index 1271bdb480cb7..a6afb6be3df1c 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/ResponseCacheStrategy.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/ResponseCacheStrategy.php @@ -194,7 +194,13 @@ private function willMakeFinalResponseUncacheable(Response $response) } /** - * Stores the cache directive relative to the age of the response. + * Store lowest max-age/s-maxage/expires for the final response. + * + * The response might have been stored in cache a while ago. To keep things comparable, + * we have to subtract the age so that the value is normalized for an age of 0. + * + * If the value is lower than the currently stored value, we update the value, to keep a rolling + * minimal value of each instruction. * * @param string $cacheKey * @param int|null $value