Skip to content

Commit

Permalink
fix: cache enabling/disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaucau committed May 20, 2023
1 parent 20d79d1 commit f2ac42a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Listener/UpdateSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function handle(Saved $event): void
}

// If the LSCache is being disabled, initiate a cache clear operation.
if (isset($event->settings['acpl-lscache.cache_enabled']) && $event->settings['acpl-lscache.cache_enabled'] === false) {
if (isset($event->settings['acpl-lscache.cache_enabled']) && ! $event->settings['acpl-lscache.cache_enabled']) {
$this->cacheClearCommand->run(new ArrayInput([]), new NullOutput());
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Middleware/LSCacheControlMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
$response = $handler->handle($request);
$method = $request->getMethod();

if ($this->settings->get('acpl-lscache.cache_enabled', true) === false) {
if (! $this->settings->get('acpl-lscache.cache_enabled')) {
return $this->withCacheControlHeader($response, 'no-cache');
}

Expand Down

0 comments on commit f2ac42a

Please sign in to comment.