From fe6e2afba4cf058536f2f178eba1c75de28afc19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Lochmu=CC=88ller?= Date: Thu, 27 Feb 2020 16:04:17 +0100 Subject: [PATCH] Fix #233 - Add the explanation cache entry only, if there is no valid one with the same URI --- Classes/Cache/StaticFileBackend.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Classes/Cache/StaticFileBackend.php b/Classes/Cache/StaticFileBackend.php index 68e1649384ae..f3f9fba93de9 100644 --- a/Classes/Cache/StaticFileBackend.php +++ b/Classes/Cache/StaticFileBackend.php @@ -53,7 +53,10 @@ public function set($entryIdentifier, $data, array $tags = [], $lifetime = null) ]; if (\in_array('explanation', $tags, true)) { $databaseData['explanation'] = $data->getHeader('X-SFC-Explanation'); - parent::set($entryIdentifier, \serialize($databaseData), $tags, $realLifetime); + if (!parent::has($entryIdentifier)) { + // Add only the details if there is no valid cache entry + parent::set($entryIdentifier, \serialize($databaseData), $tags, $realLifetime); + } return; }