Remove redundant Cache-Control directives

This commit is contained in:
Kijin Sung 2023-08-30 00:28:29 +09:00
parent a1ce3ccaf2
commit 295ac7e61e

View file

@ -472,17 +472,17 @@ class Context
{ {
if($ttl == 0) if($ttl == 0)
{ {
header('Cache-Control: ' . ($public ? 'public, ' : 'private, ') . 'must-revalidate, post-check=0, pre-check=0, no-store, no-cache'); header('Cache-Control: ' . ($public ? '' : 'private, ') . 'must-revalidate, no-store, no-cache');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
} }
elseif($ttl == -1) elseif($ttl == -1)
{ {
header('Cache-Control: ' . ($public ? 'public, ' : 'private, ') . 'must-revalidate, post-check=0, pre-check=0'); header('Cache-Control: ' . ($public ? '' : 'private, ') . 'must-revalidate');
} }
else else
{ {
header('Cache-Control: ' . ($public ? 'public, ' : 'private, ') . 'must-revalidate, max-age=' . (int)$ttl); header('Cache-Control: ' . ($public ? '' : 'private, ') . 'must-revalidate, max-age=' . (int)$ttl);
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + (int)$ttl) . ' GMT'); header('Expires: ' . gmdate('D, d M Y H:i:s', time() + (int)$ttl) . ' GMT');
} }
} }