aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Template/JSCombiner.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-05-16 09:01:20 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-05-16 09:01:20 +0200
commit6afd098a94a1354209846eea8512bf876d7dcfa5 (patch)
tree1840f51f67d41c8c2d7037d6414b9fa891db4b2e /lib/private/Template/JSCombiner.php
parente920e2028491ad841b6c6765f72bfa947a47ea9f (diff)
downloadnextcloud-server-6afd098a94a1354209846eea8512bf876d7dcfa5.tar.gz
nextcloud-server-6afd098a94a1354209846eea8512bf876d7dcfa5.zip
Cache deps list to memcache on write not on first read
Fixes #4886 Caching on first read leads to the bug that if the files are updated we will never cache again. Since we will always fetch from the memcache (which works) and then see that the files are newer. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Template/JSCombiner.php')
-rw-r--r--lib/private/Template/JSCombiner.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/Template/JSCombiner.php b/lib/private/Template/JSCombiner.php
index 604cd2cceb7..8254174bfc0 100644
--- a/lib/private/Template/JSCombiner.php
+++ b/lib/private/Template/JSCombiner.php
@@ -101,7 +101,6 @@ class JSCombiner {
if ($deps === null || $deps === '') {
$depFile = $folder->getFile($fileName);
$deps = $depFile->getContent();
- $this->depsCache->set($folder->getName() . '-' . $fileName, $deps);
}
$deps = json_decode($deps, true);
@@ -162,8 +161,11 @@ class JSCombiner {
try {
$cachedfile->putContent($res);
- $depFile->putContent(json_encode($deps));
+ $deps = json_encode($deps);
+ $depFile->putContent($deps);
+ $this->depsCache->set($folder->getName() . '-' . $depFileName, $deps);
$gzipFile->putContent(gzencode($res, 9));
+
return true;
} catch (NotPermittedException $e) {
return false;