Avoid stale-if-error if kernel.debug = true, because it hides errors

This commit is contained in:
Matthias Pigulla 2020-01-10 10:52:55 +00:00
parent d1e31a4fe0
commit 3a23ec89c3

View File

@ -37,7 +37,14 @@ abstract class HttpCache extends BaseHttpCache
$this->kernel = $kernel;
$this->cacheDir = $cacheDir;
parent::__construct($kernel, $this->createStore(), $this->createSurrogate(), array_merge(['debug' => $kernel->isDebug()], $this->getOptions()));
$isDebug = $kernel->isDebug();
$options = ['debug' => $isDebug];
if ($isDebug) {
$options['stale_if_error'] = 0;
}
parent::__construct($kernel, $this->createStore(), $this->createSurrogate(), array_merge($options, $this->getOptions()));
}
/**