Only update metadata that has changed
This commit is contained in:
parent
fee43ec506
commit
04805d0be9
1 changed files with 9 additions and 2 deletions
11
lib/files/cache/scanner.php
vendored
11
lib/files/cache/scanner.php
vendored
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue