mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Static caching merges from dnc branch
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@68900 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
0a017da580
commit
a8dca3908e
@ -342,7 +342,7 @@ class HTTP {
|
||||
// Now that we've generated them, either output them or attach them to the HTTPResponse as appropriate
|
||||
foreach($responseHeaders as $k => $v) {
|
||||
if($body) $body->addHeader($k, $v);
|
||||
else header("$k: $v");
|
||||
else if(!headers_sent()) header("$k: $v");
|
||||
}
|
||||
}
|
||||
|
||||
@ -355,6 +355,13 @@ class HTTP {
|
||||
static function gmt_date($timestamp) {
|
||||
return gmdate('D, d M Y H:i:s', $timestamp) . ' GMT';
|
||||
}
|
||||
|
||||
/*
|
||||
* Return static variable cache_age in second
|
||||
*/
|
||||
static function get_cache_age() {
|
||||
return self::$cache_age;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -479,12 +479,14 @@ class Requirements_Backend {
|
||||
$this->disabled['css'] = $this->css;
|
||||
$this->disabled['customScript'] = $this->customScript;
|
||||
$this->disabled['customCSS'] = $this->customCSS;
|
||||
Requirements::$disabled['customHeadTags'] = Requirements::$customHeadTags;
|
||||
|
||||
$this->javascript = array();
|
||||
$this->css = array();
|
||||
$this->customScript = array();
|
||||
$this->customCSS = array();
|
||||
$this->customHeadTags = array();
|
||||
Requirements::$customHeadTags = "";
|
||||
}
|
||||
}
|
||||
|
||||
@ -511,6 +513,7 @@ class Requirements_Backend {
|
||||
$this->css = $this->disabled['css'];
|
||||
$this->customScript = $this->disabled['customScript'];
|
||||
$this->customCSS = $this->disabled['customCSS'];
|
||||
Requirements::$customHeadTags = Requirements::$disabled['customHeadTags'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2332,6 +2332,15 @@ class DataObject extends ViewableData implements DataObjectInterface,i18nEntityP
|
||||
$this->componentCache = array();
|
||||
}
|
||||
|
||||
static function flush_and_destroy_cache() {
|
||||
if(self::$cache_get_one) foreach(self::$cache_get_one as $class => $items) {
|
||||
if(is_array($items)) foreach($items as $item) {
|
||||
if($item) $item->destroy();
|
||||
}
|
||||
}
|
||||
self::$cache_get_one = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Does the hard work for get_one()
|
||||
*
|
||||
|
@ -140,6 +140,12 @@ class RedirectorPage extends Page {
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
function subPagesToCache() {
|
||||
$urls = parent::subPagesToCache();
|
||||
$urls[] = $this->URLSegment . '/';
|
||||
return $urls;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -167,4 +173,4 @@ class RedirectorPage_Controller extends Page_Controller {
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user