Cache: Do not overwrite ETag when file did not change
This commit is contained in:
parent
2a2d409733
commit
3d29a82150
|
@ -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 New Issue