mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-26 13:52:24 +09:00
Merge selected commits from branch 'wkpark@varnish_cache'
This commit is contained in:
commit
0bbbc88377
3 changed files with 23 additions and 17 deletions
|
|
@ -358,6 +358,7 @@ class Context
|
|||
}
|
||||
else
|
||||
{
|
||||
$this->isSessionStarted = FALSE;
|
||||
$_SESSION = array();
|
||||
}
|
||||
|
||||
|
|
@ -475,6 +476,26 @@ class Context
|
|||
session_write_close();
|
||||
}
|
||||
|
||||
/**
|
||||
* set Cache-Control header
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setCacheControl($public = 'public', $nocache = false)
|
||||
{
|
||||
is_a($this, 'Context') ? $self = $this : $self = self::getInstance();
|
||||
|
||||
$public = !empty($public) ? $public.', ' : '';
|
||||
header("Cache-Control: ".$public."must-revalidate, post-check=0, pre-check=0");
|
||||
if ($nocache)
|
||||
{
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate", false);
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Pragma: no-cache");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the database information
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue