]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cache: don't create a new etag when the mtime hasn't changed
authorRobin Appelman <icewind@owncloud.com>
Mon, 11 Feb 2013 12:27:34 +0000 (13:27 +0100)
committerRobin Appelman <icewind@owncloud.com>
Mon, 11 Feb 2013 12:33:56 +0000 (13:33 +0100)
lib/files/cache/scanner.php

index ec2162644299e76c758e7891aa6781b7f24334bb..7f19261d972761d870d8b18b2783b735892adc4d 100644 (file)
@@ -76,6 +76,9 @@ class Scanner {
                        }
                        if ($checkExisting and $data['size'] === -1 and $cacheData = $this->cache->get($file)) {
                                $data['size'] = $cacheData['size'];
+                               if ($data['mtime'] === $cacheData['mtime']) {
+                                       $data['etag'] = $cacheData['etag'];
+                               }
                        }
                        $this->cache->put($file, $data);
                }