mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Consolidate disabling cache logic
This commit is contained in:
parent
f7f567a12e
commit
c52be7fe09
@ -771,14 +771,9 @@ class HTTPCacheControlMiddleware implements HTTPMiddleware, Resettable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Errors disable cache (unless some errors are cached intentionally by usercode)
|
// Errors disable cache (unless some errors are cached intentionally by usercode)
|
||||||
if ($response->isError()) {
|
if ($response->isError() || $response->isRedirect()) {
|
||||||
// Even if publicCache(true) is specified, errors will be uncacheable
|
// Even if publicCache(true) is specified, errors will be uncacheable
|
||||||
$this->disableCache(true);
|
$this->disableCache(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't cache redirects
|
|
||||||
if ($response->isRedirect()) {
|
|
||||||
$this->disableCache(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user