]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cache: Do not overwrite ETag when file did not change
authorArthur Schiwon <blizzz@owncloud.com>
Tue, 26 Mar 2013 15:03:40 +0000 (16:03 +0100)
committerArthur Schiwon <blizzz@owncloud.com>
Tue, 26 Mar 2013 15:03:40 +0000 (16:03 +0100)
lib/files/cache/scanner.php

index 88f208547f6162c6c4a5e279c3ebc6288cd65cf6..f0b86beb280ac78ddfda0bc74cdfa4fafd00afaa 100644 (file)
@@ -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;