dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
69038dc
)
Added logic for setting Vary header in AjaxCachePolicy
author
Daniel Kinzler
<daniel@users.mediawiki.org>
Tue, 15 Aug 2006 20:47:16 +0000
(20:47 +0000)
committer
Daniel Kinzler
<daniel@users.mediawiki.org>
Tue, 15 Aug 2006 20:47:16 +0000
(20:47 +0000)
includes/AjaxFunctions.php
patch
|
blob
|
history
diff --git
a/includes/AjaxFunctions.php
b/includes/AjaxFunctions.php
index
4387a60
..
a1a4009
100644
(file)
--- a/
includes/AjaxFunctions.php
+++ b/
includes/AjaxFunctions.php
@@
-72,15
+72,21
@@
function code2utf($num){
class AjaxCachePolicy {
var $policy;
class AjaxCachePolicy {
var $policy;
+ var $vary;
- function AjaxCachePolicy( $policy = null ) {
+ function AjaxCachePolicy( $policy = null
, $vary = null
) {
$this->policy = $policy;
$this->policy = $policy;
+ $this->vary = $vary;
}
function setPolicy( $policy ) {
$this->policy = $policy;
}
}
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 ) ) {
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}");
}
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 );
+ }
}
}
}
}