aboutsummaryrefslogtreecommitdiffstats
path: root/lib/files/cache
diff options
context:
space:
mode:
Diffstat (limited to 'lib/files/cache')
-rw-r--r--lib/files/cache/scanner.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php
index 46122221dc2..cd022d25132 100644
--- a/lib/files/cache/scanner.php
+++ b/lib/files/cache/scanner.php
@@ -78,7 +78,7 @@ class Scanner {
$this->scanFile($parent);
}
}
- if($cacheData = $this->cache->get($file)) {
+ if ($cacheData = $this->cache->get($file)) {
if ($data['mtime'] === $cacheData['mtime'] &&
$data['size'] === $cacheData['size']) {
$data['etag'] = $cacheData['etag'];
@@ -89,7 +89,14 @@ class Scanner {
$data['size'] = $cacheData['size'];
}
}
- $this->cache->put($file, $data);
+ $newData = $data;
+ if ($cacheData) {
+ // Only update metadata that has changed
+ $newData = array_diff($data, $cacheData);
+ }
+ if (!empty($newData)) {
+ $this->cache->put($file, $newData);
+ }
}
return $data;
}