Merge pull request #24997 from nextcloud/backport/24988/stable20
[stable20] Set the JSCombiner cache if needed
This commit is contained in:
commit
2fa3f24d04
|
@ -121,7 +121,9 @@ class JSCombiner {
|
||||||
$fileName = $fileName . '.deps';
|
$fileName = $fileName . '.deps';
|
||||||
try {
|
try {
|
||||||
$deps = $this->depsCache->get($folder->getName() . '-' . $fileName);
|
$deps = $this->depsCache->get($folder->getName() . '-' . $fileName);
|
||||||
|
$fromCache = true;
|
||||||
if ($deps === null || $deps === '') {
|
if ($deps === null || $deps === '') {
|
||||||
|
$fromCache = false;
|
||||||
$depFile = $folder->getFile($fileName);
|
$depFile = $folder->getFile($fileName);
|
||||||
$deps = $depFile->getContent();
|
$deps = $depFile->getContent();
|
||||||
}
|
}
|
||||||
|
@ -144,6 +146,10 @@ class JSCombiner {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($fromCache === false) {
|
||||||
|
$this->depsCache->set($folder->getName() . '-' . $fileName, json_encode($deps));
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (NotFoundException $e) {
|
} catch (NotFoundException $e) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue