From 0e07a69682ebc1c3d6f7db5c8aa176c956a9d5dd Mon Sep 17 00:00:00 2001 From: xdpirate <1757462+xdpirate@users.noreply.github.com> Date: Tue, 12 Mar 2024 02:20:42 +0100 Subject: [PATCH] Invalidate cache upon update --- index.php | 9 +++++++++ php/update.php | 4 +--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 2d61959..37895f4 100644 --- a/index.php +++ b/index.php @@ -29,6 +29,15 @@ error_reporting(E_ERROR | E_WARNING | E_PARSE); ini_set("display_errors", 1); +if(isset($_GET['invalidateCache'])) { + header("Expires: Tue, 01 Jan 2000 00:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); + header("Location: ./"); +} + $platformList = ["PS5", "PS4", "XSX", "XB1", "Switch", "PC", "Android", "PSVR2", "iOS"]; sort($platformList); diff --git a/php/update.php b/php/update.php index a7a3d78..6a884c0 100644 --- a/php/update.php +++ b/php/update.php @@ -74,9 +74,7 @@ print("
Success! This installation of GameHorizon has been updated to $commitHash.

- To avoid errors from stale cache entries in your browser, it's a good idea to clear the cache once you exit the updater. You can do this by pressing Ctrl+F5, or by holding down Shift, then clicking the Refresh button in your browser toolbar with the cursor.

- See commit history

- + See commit history (opens in a new tab) or
"); }