From 7253deb85ac161156e916c113f8820941dc80547 Mon Sep 17 00:00:00 2001 From: Sven Proffe Date: Wed, 23 Apr 2025 13:06:06 +0200 Subject: [PATCH] Fix caching bug in multi-site enironments In Compiler.php the cache key generation does not take different variables for different sites into account. Thus, CSS gets compiled over and over again when requests to one site overwrite the cache of another site (with different variables) --- Classes/Compiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Compiler.php b/Classes/Compiler.php index a89d7d6..bccd10e 100644 --- a/Classes/Compiler.php +++ b/Classes/Compiler.php @@ -102,7 +102,7 @@ public static function compileFile(string $scssFilePath, array $variables, ?stri /** @var FileBackend $cache */ $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('ws_scss'); - $cacheKey = hash('sha1', $scssFilePath); + $cacheKey = hash('sha1', $scssFilePath . ($variablesHash ?? '')); $calculatedContentHash = self::calculateContentHash($scssFilePath, $variables); $calculatedContentHash .= md5($cssFilePath); if ($useSourceMap) {