Skip to content

Instantly share code, notes, and snippets.

@unaibamir
Created December 29, 2018 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unaibamir/dc87c19a666ba120801a7806f455feb5 to your computer and use it in GitHub Desktop.
Save unaibamir/dc87c19a666ba120801a7806f455feb5 to your computer and use it in GitHub Desktop.
add_action( "wp_head", "_wn_no_cache" );
function _wn_no_cache() {
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Pragma: no-cache"); // HTTP/1.0
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment