Skip to content

Commit

Permalink
MINOR static publisher cache debugging (from r84871)
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89156 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
Sam Minnee committed Oct 15, 2009
1 parent 4ab8055 commit d3ae7b1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions static-main.php
Expand Up @@ -14,6 +14,7 @@
*/

$cacheOn = true;
$cacheDebug = false;
$hostmapLocation = '../subsites/host-map.php';

if ($cacheOn) {
Expand All @@ -38,10 +39,12 @@
} elseif (file_exists('../cache/'.$cacheDir.$file.'.php')) {
header('X-cache: hit at '.date('r'));
include_once '../cache/'.$cacheDir.$file.'.php';
if ($cacheDebug) echo "<h1>File was cached</h1>";
} else {
header('X-cache: miss at '.date('r') . ' on ' . $cacheDir . $file);
// No cache hit... fallback!!!
include 'main.php';
if ($cacheDebug) echo "<h1>File was !NOT! cached</h1>";
}
} else {
include 'main.php';
Expand Down

0 comments on commit d3ae7b1

Please sign in to comment.