| OLD | NEW |
| 1 <?php | 1 <?php |
| 2 if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) { | 2 if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) { |
| 3 header('HTTP/1.1 304 Not Modified'); | 3 header('HTTP/1.1 304 Not Modified'); |
| 4 exit; | 4 exit; |
| 5 } | 5 } |
| 6 | 6 |
| 7 $type = $_GET["type"]; | 7 $type = $_GET["type"]; |
| 8 | 8 |
| 9 $response_code = 200; | 9 $response_code = 200; |
| 10 $body = ""; | 10 $body = ""; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 break; | 42 break; |
| 43 | 43 |
| 44 default: | 44 default: |
| 45 $response_code = 404; | 45 $response_code = 404; |
| 46 break; | 46 break; |
| 47 } | 47 } |
| 48 | 48 |
| 49 header("HTTP/1.1 $response_code"); | 49 header("HTTP/1.1 $response_code"); |
| 50 header("Content-type: $content_type"); | 50 header("Content-type: $content_type"); |
| 51 if (isset($_GET["cacheable"])) { | 51 if (isset($_GET["cacheable"])) { |
| 52 header("Etag: 7"); | 52 if ($_GET["cacheable"] == 1) { |
| 53 header("Cache-control: max-age=120"); |
| 54 } else { |
| 55 header("Etag: 7"); |
| 56 } |
| 53 } else { | 57 } else { |
| 54 header("Cache-control: no-cache"); | 58 header("Cache-control: no-cache"); |
| 55 } | 59 } |
| 56 print($body); | 60 print($body); |
| 57 exit; | 61 exit; |
| 58 ?> | 62 ?> |
| OLD | NEW |