equal
deleted
inserted
replaced
292 } |
292 } |
293 if ( is_array($cache_file) && isset($cache_file['md5']) && isset($cache_file['src']) ) |
293 if ( is_array($cache_file) && isset($cache_file['md5']) && isset($cache_file['src']) ) |
294 { |
294 { |
295 if ( $cache_file['md5'] === $file_md5 ) |
295 if ( $cache_file['md5'] === $file_md5 ) |
296 { |
296 { |
|
297 header("X-Cache-Status: cache HIT, hash $file_md5"); |
297 $loaded_cache = true; |
298 $loaded_cache = true; |
298 $file_contents = $cache_file['src']; |
299 $file_contents = $cache_file['src']; |
299 } |
300 } |
300 } |
301 } |
301 } |
302 } |
313 'md5' => $file_md5, |
314 'md5' => $file_md5, |
314 'src' => $file_contents |
315 'src' => $file_contents |
315 )); |
316 )); |
316 fwrite($handle, $payload); |
317 fwrite($handle, $payload); |
317 fclose($handle); |
318 fclose($handle); |
318 } |
319 header("X-Cache-Status: cache MISS, new generated"); |
|
320 } |
|
321 else |
|
322 { |
|
323 header("X-Cache-Status: cache MISS, not generated"); |
|
324 } |
|
325 } |
|
326 else if ( !$loaded_cache ) |
|
327 { |
|
328 header("X-Cache-Status: cache MISS, not generated"); |
319 } |
329 } |
320 |
330 |
321 return $file_contents; |
331 return $file_contents; |
322 } |
332 } |
323 |
333 |