Skip to content

Commit 660d997

Browse files
author
Lee Hicks
authored
DF-1301 #comment Do not cache full responses with error status codes
2 parents c6ee8d4 + 90e463d commit 660d997

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Services/Script.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ protected function processRequest()
315315
$result = ResponseFactory::create($result);
316316
}
317317

318-
if ($cacheKey) {
318+
$status = $result->getStatusCode();
319+
if ($cacheKey && (($status >= 200) && ($status < 300))) { // do not cache error responses
319320
$this->addToCache($cacheKey, $result);
320321
}
321322

0 commit comments

Comments
 (0)