From: Daniel Kinzler Date: Tue, 15 Aug 2006 20:47:16 +0000 (+0000) Subject: Added logic for setting Vary header in AjaxCachePolicy X-Git-Tag: 1.31.0-rc.0~55979 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=ee88c38f1fa5acbcd0835d7fac3c3d7638fce110;p=lhc%2Fweb%2Fwiklou.git Added logic for setting Vary header in AjaxCachePolicy --- diff --git a/includes/AjaxFunctions.php b/includes/AjaxFunctions.php index 4387a607a3..a1a400994b 100644 --- a/includes/AjaxFunctions.php +++ b/includes/AjaxFunctions.php @@ -72,15 +72,21 @@ function code2utf($num){ class AjaxCachePolicy { var $policy; + var $vary; - function AjaxCachePolicy( $policy = null ) { + function AjaxCachePolicy( $policy = null, $vary = null ) { $this->policy = $policy; + $this->vary = $vary; } function setPolicy( $policy ) { $this->policy = $policy; } + function setVary( $vary ) { + $this->vary = $vary; + } + function writeHeader() { header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); if ( is_null( $this->policy ) ) { @@ -93,6 +99,10 @@ class AjaxCachePolicy { header ("Expires: " . gmdate( "D, d M Y H:i:s", time() + $this->policy ) . " GMT"); header ("Cache-Control: s-max-age={$this->policy},public,max-age={$this->policy}"); } + + if ( $this->vary ) { + header ( "Vary: " . $this->vary ); + } } }