From ee88c38f1fa5acbcd0835d7fac3c3d7638fce110 Mon Sep 17 00:00:00 2001 From: Daniel Kinzler Date: Tue, 15 Aug 2006 20:47:16 +0000 Subject: [PATCH] Added logic for setting Vary header in AjaxCachePolicy --- includes/AjaxFunctions.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 ); + } } } -- 2.20.1