Skip to content

Commit

Permalink
Merge pull request #115 from jingu/1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
koriym committed Jul 7, 2022
2 parents 89de326 + f4aba40 commit d9db550
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/AbstractDonutCacheInterceptor.php
Expand Up @@ -4,6 +4,7 @@

namespace BEAR\QueryRepository;

use BEAR\Resource\Code;
use BEAR\Resource\ResourceObject;
use Ray\Aop\MethodInterceptor;
use Ray\Aop\MethodInvocation;
Expand Down Expand Up @@ -48,8 +49,9 @@ final public function invoke(MethodInvocation $invocation)

/** @var ResourceObject $ro */
$ro = $invocation->proceed();
if (isset($ro->headers[Header::ETAG])) {
return $ro; // donut created in ResourceObject
// donut created in ResourceObject
if (isset($ro->headers[Header::ETAG]) || $ro->code >= Code::BAD_REQUEST) {
return $ro;
}

return static::IS_ENTIRE_CONTENT_CACHEABLE ?
Expand Down

0 comments on commit d9db550

Please sign in to comment.