Skip to content

Commit

Permalink
BUGFIX: Added X-Forwarded-Protocol and User-Agent to Vary header.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Minnee committed Jan 8, 2013
1 parent b63e55a commit b114aa2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions control/HTTP.php
Expand Up @@ -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";
}
Expand Down

0 comments on commit b114aa2

Please sign in to comment.