mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Cache: Do not overwrite ETag when file did not change
This commit is contained in:
parent
2a2d409733
commit
3d29a82150
1 changed files with 6 additions and 4 deletions
10
lib/files/cache/scanner.php
vendored
10
lib/files/cache/scanner.php
vendored
|
|
@ -74,14 +74,16 @@ class Scanner {
|
|||
$this->scanFile($parent);
|
||||
}
|
||||
}
|
||||
if ($checkExisting and $cacheData = $this->cache->get($file)) {
|
||||
if ($data['size'] === -1) {
|
||||
$data['size'] = $cacheData['size'];
|
||||
}
|
||||
if($cacheData = $this->cache->get($file)) {
|
||||
if ($data['mtime'] === $cacheData['mtime']) {
|
||||
$data['etag'] = $cacheData['etag'];
|
||||
}
|
||||
}
|
||||
if ($checkExisting and $cacheData) {
|
||||
if ($data['size'] === -1) {
|
||||
$data['size'] = $cacheData['size'];
|
||||
}
|
||||
}
|
||||
$this->cache->put($file, $data);
|
||||
}
|
||||
return $data;
|
||||
|
|
|
|||
Loading…
Reference in a new issue