Skip to content

Commit

Permalink
chore: Increase cache headers to 3 hours (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
DenverCoder1 authored Oct 5, 2023
1 parent caa9a84 commit 1e6de36
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
renderOutput($message, 500);
}

// set cache to refresh once per hour
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 3600) . " GMT");
// set cache to refresh once per three horus
$cacheMinutes = 3 * 60 * 60;
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $cacheMinutes) . " GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: public, max-age=3600");
header("Cache-Control: public, max-age=$cacheMinutes");

// redirect to demo site if user is not given
if (!isset($_REQUEST["user"])) {
Expand Down

0 comments on commit 1e6de36

Please sign in to comment.