diff --git a/Neos.Fusion/Classes/Core/Cache/ParserCache.php b/Neos.Fusion/Classes/Core/Cache/ParserCache.php index e5a8bb166c2..b7e48bfaf36 100644 --- a/Neos.Fusion/Classes/Core/Cache/ParserCache.php +++ b/Neos.Fusion/Classes/Core/Cache/ParserCache.php @@ -78,11 +78,16 @@ public function cacheForDsl(string $identifier, string $code, \Closure $generate private function cacheForIdentifier(string $identifier, \Closure $generateValueToCache): mixed { - if ($this->parsePartialsCache->has($identifier)) { - return $this->parsePartialsCache->get($identifier); + $value = $this->parsePartialsCache->get($identifier); + if ($value !== false) { + return $value; } $value = $generateValueToCache(); - $this->parsePartialsCache->set($identifier, $value); + if ($value !== false) { + // in the rare edge-case of a fusion dsl returning `false` we cannot cache it, + // as the above get would be ignored. This is an acceptable compromise. + $this->parsePartialsCache->set($identifier, $value); + } return $value; }