Skip to content

Commit 56596df

Browse files
committed
Avoid stale-if-error if kernel.debug = true, because it hides errors
1 parent 93f7e17 commit 56596df

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

HttpCache/HttpCache.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ public function __construct(KernelInterface $kernel, $cacheDir = null)
3737
$this->kernel = $kernel;
3838
$this->cacheDir = $cacheDir;
3939

40-
parent::__construct($kernel, $this->createStore(), $this->createSurrogate(), array_merge(['debug' => $kernel->isDebug()], $this->getOptions()));
40+
$isDebug = $kernel->isDebug();
41+
$options = ['debug' => $isDebug];
42+
43+
if ($isDebug) {
44+
$options['stale_if_error'] = 0;
45+
}
46+
47+
parent::__construct($kernel, $this->createStore(), $this->createSurrogate(), array_merge($options, $this->getOptions()));
4148
}
4249

4350
/**

0 commit comments

Comments
 (0)