Last active
June 16, 2017 15:46
-
-
Save andybeak/4f736bb5c3be39fdaa60a0bacc13eb6b to your computer and use it in GitHub Desktop.
I set an ETag that is based on a static version number because the only time I would want to process the file is if the version changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == sha1('version 1.0')) { | |
header('HTTP/1.1 304 Not Modified'); | |
exit; | |
} | |
header('Cache-Control: max-age=604800, public'); | |
header('ETag: ' . sha1('version 1.0') ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment