Skip to content
Snippets Groups Projects

created cache file

Closed Brown, Jonathan D. requested to merge github/fork/jdbrown-USGS/issue-20 into master
1 file
+ 27
0
Compare changes
  • Side-by-side
  • Inline
+ 27
0
<?php
/**
* Handles caching headers.
* $MODIFIED - when the page was last modified, default is time().
* $CACHE_MAXAGE - maximum age in seconds, default is 900 (15 minutes).
*/
if (!defined('RFC_DATE')) {
define('RFC_DATE', 'D, d M Y H:i:s \G\M\T');
}
// set defaults
if (!isset($MODIFIED)) {
$MODIFIED = time();
}
if (!isset($CACHE_MAXAGE)) {
$CACHE_MAXAGE = 900;
}
if ($CACHE_MAXAGE >= 0) {
header('Cache-Control: public, max-age=' . $CACHE_MAXAGE);
header('Expires: ' . gmdate(RFC_DATE, time() + $CACHE_MAXAGE));
}
header('Last-Modified: ' . gmdate(RFC_DATE, $MODIFIED));
?>
Loading