From 6f8f7ba90a3e9ad1b5b2f52c17bd22f55520feed Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 12 Apr 2010 02:33:08 +0000 Subject: [PATCH] MINOR if looking at a specific stage, set a cooking to bypass static cacheing (from r91006) (from r96738) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102364 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/Versioned.php | 1 + static-main.php | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/model/Versioned.php b/core/model/Versioned.php index ad038e2bd..28ee75f6a 100755 --- a/core/model/Versioned.php +++ b/core/model/Versioned.php @@ -579,6 +579,7 @@ class Versioned extends DataObjectDecorator { $_GET['stage'] = ucfirst(strtolower($_GET['stage'])); Session::set('currentStage', $_GET['stage']); Session::clear('archiveDate'); + Cookie::set('bypassStaticCache', '1', 0); } if(isset($_GET['archiveDate'])) { Session::set('archiveDate', $_GET['archiveDate']); diff --git a/static-main.php b/static-main.php index b7ab6d7f8..45d403817 100644 --- a/static-main.php +++ b/static-main.php @@ -18,8 +18,7 @@ $cacheDebug = false; $hostmapLocation = '../subsites/host-map.php'; date_default_timezone_set('Pacific/Auckland'); - -if ($cacheOn) { +if ($cacheOn && empty($_COOKIE['bypassStaticCache'])) { if (file_exists($hostmapLocation)) { include_once $hostmapLocation; $subsiteHostmap['default'] = isset($subsiteHostmap['default']) ? $subsiteHostmap['default'] : '';