Skip to content

Instantly share code, notes, and snippets.

@abdallaadelessa
Created July 29, 2015 10:30
Show Gist options
  • Save abdallaadelessa/e59c2d70b9929abbfd85 to your computer and use it in GitHub Desktop.
Save abdallaadelessa/e59c2d70b9929abbfd85 to your computer and use it in GitHub Desktop.
<?php
//set headers to NOT cache a page
header("Cache-Control: no-cache, must-revalidate"); //HTTP 1.1
header("Pragma: no-cache"); //HTTP 1.0
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
//or, if you DO want a file to cache, use:
header("Cache-Control: max-age=2592000"); //30days (60sec * 60min * 24hours * 30days)
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment