From 3010bd52f2eeb283a5a451b539ba50f952d5b9dd Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Wed, 8 Oct 2014 21:21:46 +0200 Subject: [PATCH] Faster ETag computation --- src/Services/NetworkingService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/NetworkingService.php b/src/Services/NetworkingService.php index ddd12f4d..1731e63b 100644 --- a/src/Services/NetworkingService.php +++ b/src/Services/NetworkingService.php @@ -19,7 +19,7 @@ class NetworkingService $secondsToLive = $daysToLive * 24 * 60 * 60; $lastModified = filemtime($fullPath); - $eTag = md5(file_get_contents($fullPath)); //todo: faster + $eTag = md5($fullPath . $lastModified); $ifModifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? $_SERVER['HTTP_IF_MODIFIED_SINCE']