From b1a86b5f9f93d499459368854f96401c298881c8 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 30 Jul 2016 16:14:54 +1000 Subject: [PATCH] Performance enhancement Don't use deep handing lastMod check if we don't have to --- modules/system/classes/CombineAssets.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/system/classes/CombineAssets.php b/modules/system/classes/CombineAssets.php index 7c903ff1f..e2e4d84f6 100644 --- a/modules/system/classes/CombineAssets.php +++ b/modules/system/classes/CombineAssets.php @@ -309,8 +309,14 @@ class CombineAssets $this->setHashOnCombinerFilters($cacheKey); $combiner = $this->prepareCombiner($assets); - $factory = new AssetFactory($this->localPath); - $lastMod = $factory->getLastModified($combiner); + + if ($this->useDeepHashing) { + $factory = new AssetFactory($this->localPath); + $lastMod = $factory->getLastModified($combiner); + } + else { + $lastMod = $combiner->getLastModified(); + } $cacheInfo = [ 'version' => $cacheKey.'-'.$lastMod,