Faster ETag computation

This commit is contained in:
Marcin Kurczewski 2014-10-08 21:21:46 +02:00
parent 04bdb04f20
commit 3010bd52f2

View file

@ -19,7 +19,7 @@ class NetworkingService
$secondsToLive = $daysToLive * 24 * 60 * 60; $secondsToLive = $daysToLive * 24 * 60 * 60;
$lastModified = filemtime($fullPath); $lastModified = filemtime($fullPath);
$eTag = md5(file_get_contents($fullPath)); //todo: faster $eTag = md5($fullPath . $lastModified);
$ifModifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) $ifModifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])
? $_SERVER['HTTP_IF_MODIFIED_SINCE'] ? $_SERVER['HTTP_IF_MODIFIED_SINCE']