| OLD | NEW |
| 1 <?php | 1 <?php |
| 2 if ($_SERVER["HTTP_IF_MODIFIED_SINCE"]) { | 2 if ($_SERVER["HTTP_IF_MODIFIED_SINCE"]) { |
| 3 header("HTTP/1.0 304 Not Modified"); | 3 header("HTTP/1.0 304 Not Modified"); |
| 4 exit; | 4 exit; |
| 5 } | 5 } |
| 6 | 6 |
| 7 $max_age = 12 * 31 * 24 * 60 * 60; //one year | 7 $max_age = 12 * 31 * 24 * 60 * 60; //one year |
| 8 $expires = gmdate(DATE_RFC1123, time() + $max_age); | 8 $expires = gmdate(DATE_RFC1123, time() + $max_age); |
| 9 $last_modified = gmdate(DATE_RFC1123, time() - $max_age); | 9 $last_modified = gmdate(DATE_RFC1123, time() - $max_age); |
| 10 | 10 |
| 11 header("Cache-Control: public, max-age=" . 5*$max_age); | 11 header("Cache-Control: public, max-age=" . 5*$max_age); |
| 12 header("Cache-control: max-age=0"); | 12 header("Cache-control: max-age=0"); |
| 13 header("Expires: " . $expires); | 13 header("Expires: " . $expires); |
| 14 header("Content-Type: text/html"); | 14 header("Content-Type: text/html"); |
| 15 header("Last-Modified: " . $last_modified); | 15 header("Last-Modified: " . $last_modified); |
| 16 | 16 |
| 17 echo("console.log(\"Done.\");"); | 17 echo("console.log(\"Done.\");"); |
| 18 echo("var randomValue = " . rand() . ";"); | 18 echo("var randomValue = " . rand() . ";"); |
| 19 ?> | 19 ?> |
| OLD | NEW |