Created
January 26, 2015 07:04
-
-
Save Sketches-su/5c4620a0e6a7717e6354 to your computer and use it in GitHub Desktop.
Выдаёт HTTP-заголовки, запрещающие кэширование
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
function noCaching() | |
{ | |
if ((PHP_SAPI == 'cli') || headers_sent()) { | |
return; | |
} | |
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); | |
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); | |
header('Cache-Control: no-store, no-cache, must-revalidate'); | |
header('Cache-Control: post-check=0, pre-check=0', false); | |
header('Pragma: no-cache'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment