From b114aa24889b23f1f55d2cb7c9df4962fdb1d58e Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 7 Jul 2011 17:28:58 +1200 Subject: [PATCH] BUGFIX: Added X-Forwarded-Protocol and User-Agent to Vary header. --- control/HTTP.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/control/HTTP.php b/control/HTTP.php index 03e776efa84..a6a2074a2c7 100644 --- a/control/HTTP.php +++ b/control/HTTP.php @@ -287,6 +287,10 @@ public static function add_cache_headers($body = null) { if(self::$cache_age > 0) { $responseHeaders["Cache-Control"] = "max-age=" . self::$cache_age . ", must-revalidate"; $responseHeaders["Pragma"] = ""; + + // To do: User-Agent should only be added in situations where you *are* actually varying according to user-agent. + $responseHeaders['Vary'] = 'Cookie, X-Forwarded-Protocol, User-Agent'; + } else { $responseHeaders["Cache-Control"] = "no-cache, max-age=0, must-revalidate"; }