Permalink
Browse files

BUGFIX: Added X-Forwarded-Protocol and User-Agent to Vary header.

  • Loading branch information...
1 parent b63e55a commit b114aa24889b23f1f55d2cb7c9df4962fdb1d58e @sminnee sminnee committed Jul 7, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 control/HTTP.php
View
@@ -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";
}

0 comments on commit b114aa2

Please sign in to comment.