@@ 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; |
@@ 140-144 (lines=5) @@ | ||
137 | } |
|
138 | ||
139 | $eTag = '"' . substr(sha1($request) . $cached['time'], 0, 64) . '"'; |
|
140 | if (!empty($_SERVER['HTTP_IF_NONE_MATCH']) && strpos($_SERVER['HTTP_IF_NONE_MATCH'], $eTag) !== false) |
|
141 | { |
|
142 | header('HTTP/1.1 304 Not Modified'); |
|
143 | exit; |
|
144 | } |
|
145 | ||
146 | // Make sure we're serving an image |
|
147 | $contentParts = explode('/', !empty($cached['content_type']) ? $cached['content_type'] : ''); |