Skip to content

Instantly share code, notes, and snippets.

@lupin72
Last active April 26, 2016 12:03
Show Gist options
  • Save lupin72/421242c47dd2371c840d3caa957096f1 to your computer and use it in GitHub Desktop.
Save lupin72/421242c47dd2371c840d3caa957096f1 to your computer and use it in GitHub Desktop.
WordPress - Prevent browser from caching authenticated pages
function example_update_nocache_headers($headers) {
$headers['Cache-Control'] = 'no-cache, must-revalidate, max-age=0, no-store';
$headers['Pragma'] = 'no-cache';
return $headers;
}
add_filter('nocache_headers','example_update_nocache_headers');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment