mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR static publisher cache debugging (from r84871)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89156 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
4ab8055c29
commit
d3ae7b1d7f
@ -14,6 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$cacheOn = true;
|
$cacheOn = true;
|
||||||
|
$cacheDebug = false;
|
||||||
$hostmapLocation = '../subsites/host-map.php';
|
$hostmapLocation = '../subsites/host-map.php';
|
||||||
|
|
||||||
if ($cacheOn) {
|
if ($cacheOn) {
|
||||||
@ -38,10 +39,12 @@ if ($cacheOn) {
|
|||||||
} elseif (file_exists('../cache/'.$cacheDir.$file.'.php')) {
|
} elseif (file_exists('../cache/'.$cacheDir.$file.'.php')) {
|
||||||
header('X-cache: hit at '.date('r'));
|
header('X-cache: hit at '.date('r'));
|
||||||
include_once '../cache/'.$cacheDir.$file.'.php';
|
include_once '../cache/'.$cacheDir.$file.'.php';
|
||||||
|
if ($cacheDebug) echo "<h1>File was cached</h1>";
|
||||||
} else {
|
} else {
|
||||||
header('X-cache: miss at '.date('r') . ' on ' . $cacheDir . $file);
|
header('X-cache: miss at '.date('r') . ' on ' . $cacheDir . $file);
|
||||||
// No cache hit... fallback!!!
|
// No cache hit... fallback!!!
|
||||||
include 'main.php';
|
include 'main.php';
|
||||||
|
if ($cacheDebug) echo "<h1>File was !NOT! cached</h1>";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
include 'main.php';
|
include 'main.php';
|
||||||
|
Loading…
Reference in New Issue
Block a user