We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1655777 commit 5968abaCopy full SHA for 5968aba
1 file changed
src/Http/Middleware/CacheMiddleware.php
@@ -26,8 +26,9 @@ public function __construct(
26
protected Driver $driver,
27
protected int $ttl,
28
protected ?string $cacheKey,
29
- protected bool $invalidate = false,
30
- ) {
+ protected bool $invalidate = false,
+ )
31
+ {
32
//
33
}
34
@@ -53,7 +54,7 @@ public function __invoke(PendingRequest $pendingRequest): ?SimulatedResponsePayl
53
54
// the SimulatedResponsePayload here.
55
56
if ($this->invalidate === false && $cachedResponse->hasNotExpired()) {
- $pendingRequest->middleware()->onResponse(fn (Response $response) => $response->setCached(true));
57
+ $pendingRequest->middleware()->onResponse(fn(Response $response) => $response->setCached(true), true);
58
59
return $cachedResponse->getSimulatedResponsePayload();
60
0 commit comments