@@ 218-224 (lines=7) @@ | ||
215 | ||
216 | // Check whether the ETag was sent back, and cache based on that... |
|
217 | $eTag = '"' . substr($_REQUEST['attach'] . $file['filePath'] . filemtime($file['filePath']), 0, 64) . '"'; |
|
218 | if (!empty($_SERVER['HTTP_IF_NONE_MATCH']) && strpos($_SERVER['HTTP_IF_NONE_MATCH'], $eTag) !== false) |
|
219 | { |
|
220 | ob_end_clean(); |
|
221 | ||
222 | header('HTTP/1.1 304 Not Modified'); |
|
223 | exit; |
|
224 | } |
|
225 | ||
226 | // If this is a partial download, we need to determine what data range to send |
|
227 | $range = 0; |
@@ 129-133 (lines=5) @@ | ||
126 | } |
|
127 | ||
128 | $eTag = '"' . substr(sha1($request) . $cached['time'], 0, 64) . '"'; |
|
129 | if (!empty($_SERVER['HTTP_IF_NONE_MATCH']) && strpos($_SERVER['HTTP_IF_NONE_MATCH'], $eTag) !== false) |
|
130 | { |
|
131 | header('HTTP/1.1 304 Not Modified'); |
|
132 | exit; |
|
133 | } |
|
134 | ||
135 | // Make sure we're serving an image |
|
136 | $contentParts = explode('/', !empty($cached['content_type']) ? $cached['content_type'] : ''); |