From ac67fb7337627cc07575d7cdb2f2cbdccee0514e Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 17 Jun 2016 16:30:42 +0100 Subject: [PATCH] Switching back to more stable cache key #906 --- system/src/Grav/Common/Assets.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/system/src/Grav/Common/Assets.php b/system/src/Grav/Common/Assets.php index 26fcde238..945022859 100644 --- a/system/src/Grav/Common/Assets.php +++ b/system/src/Grav/Common/Assets.php @@ -671,11 +671,14 @@ class Assets // temporary list of assets to pipeline $temp_css = []; + /** @var Cache $cache */ + $cache = Grav::instance()['cache']; + // clear no-pipeline assets lists $this->css_no_pipeline = []; // Compute uid based on assets and timestamp - $uid = md5(json_encode($this->css) . $this->css_minify . $this->css_rewrite . $group . time()); + $uid = md5(json_encode($this->css) . $this->css_minify . $this->css_rewrite . $group . $cache->getKey()); $file = $uid . '.css'; $inline_file = $uid . '-inline.css'; @@ -753,11 +756,14 @@ class Assets // temporary list of assets to pipeline $temp_js = []; + /** @var Cache $cache */ + $cache = Grav::instance()['cache']; + // clear no-pipeline assets lists $this->js_no_pipeline = []; // Compute uid based on assets and timestamp - $uid = md5(json_encode($this->js) . $this->js_minify . $group . time()); + $uid = md5(json_encode($this->js) . $this->js_minify . $group . $cache->getKey()); $file = $uid . '.js'; $inline_file = $uid . '-inline.js';