diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php index 5fd4bf968e83..d8a4f95e10db 100644 --- a/lib/private/Files/Cache/Scanner.php +++ b/lib/private/Files/Cache/Scanner.php @@ -191,9 +191,7 @@ public function scanFile($file, $reuseExisting = 0, $parentId = -1, $cacheData = if (isset($data['storage_mtime'], $cacheData['storage_mtime']) && $data['storage_mtime'] === $cacheData['storage_mtime']) { $data['mtime'] = $cacheData['mtime']; if (($reuseExisting & self::REUSE_SIZE) && ($data['size'] === -1)) { - if (($data['mimetype'] !== 'httpd/unix-directory') || !($reuseExisting & self::REUSE_ONLY_FOR_FILES)) { - $data['size'] = $cacheData['size']; - } + $data['size'] = $cacheData['size']; } if ($reuseExisting & self::REUSE_ETAG) { if (($data['mimetype'] !== 'httpd/unix-directory') || !($reuseExisting & self::REUSE_ONLY_FOR_FILES)) { diff --git a/lib/private/Files/Cache/Watcher.php b/lib/private/Files/Cache/Watcher.php index 4e106f0bae5b..627bb4774d29 100644 --- a/lib/private/Files/Cache/Watcher.php +++ b/lib/private/Files/Cache/Watcher.php @@ -100,7 +100,7 @@ public function checkUpdate($path, $cachedEntry = null) { */ public function update($path, $cachedData) { if ($this->storage->is_dir($path)) { - $this->scanner->scan($path, Scanner::SCAN_SHALLOW, Scanner::REUSE_ETAG | Scanner::REUSE_ONLY_FOR_FILES); + $this->scanner->scan($path, Scanner::SCAN_SHALLOW, Scanner::REUSE_ETAG | Scanner::REUSE_SIZE | Scanner::REUSE_ONLY_FOR_FILES); } else { $this->scanner->scanFile($path); } diff --git a/lib/public/Files/Cache/IScanner.php b/lib/public/Files/Cache/IScanner.php index 8d76fe0107ed..d7c4a889fd71 100644 --- a/lib/public/Files/Cache/IScanner.php +++ b/lib/public/Files/Cache/IScanner.php @@ -34,7 +34,7 @@ interface IScanner { const REUSE_NONE = 0; const REUSE_ETAG = 1; const REUSE_SIZE = 2; - const REUSE_ONLY_FOR_FILES = 4; // apply the reuse (either tag or size) only to files, not folders + const REUSE_ONLY_FOR_FILES = 4; // apply the etag reuse only to files, not folders /** * scan a single file and store it in the cache