Cache only non-empty result sets

This commit is contained in:
Alexander Bigga 2021-11-18 21:05:10 +01:00
parent f9c2c7ac9b
commit 4b6f28cd24
1 changed files with 3 additions and 1 deletions

View File

@ -483,7 +483,9 @@ class Solr implements LoggerAwareInterface
$resultSet[] = $doc;
}
// Save value in cache.
$cache->set($cacheIdentifier, $resultSet);
if ($resultSet) {
$cache->set($cacheIdentifier, $resultSet);
}
} else {
// Return cache hit.
$resultSet = $entry;