mirror of
https://github.com/silverstripe/silverstripe-staticpublisher
synced 2024-10-22 14:05:54 +02:00
NEW Adding debug helpers for skipping cache
This commit is contained in:
parent
d53b3ad855
commit
d6d220af5c
6
main.php
6
main.php
@ -135,7 +135,7 @@ if (
|
||||
header('Cache-Control: public');
|
||||
header('X-SilverStripe-Cache: hit at '.@date('r'));
|
||||
|
||||
if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])==$lastModified || $etagHeader == $etagFile) {
|
||||
if (($ifModifiedSince && @strtotime($ifModifiedSince)==$lastModified) || $etagHeader == $etagFile) {
|
||||
header("HTTP/1.1 304 Not Modified");
|
||||
exit;
|
||||
}
|
||||
@ -162,6 +162,10 @@ if (
|
||||
}
|
||||
} else {
|
||||
// Fall back to dynamic generation via normal routing if caching has been explicitly disabled
|
||||
header('X-SilverStripe-Cache: skipped at '.@date('r'));
|
||||
if ($cacheDebug) {
|
||||
echo "<h1>Cache skipped</h1>";
|
||||
}
|
||||
skipCache();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user