From 8f8b5ed302354647234fdb7dc39364dbc66a1099 Mon Sep 17 00:00:00 2001 From: Malte Bublitz Date: Fri, 2 May 2025 21:45:16 +0200 Subject: [PATCH] =?utf8?q?=F0=9F=9A=A8=20CSS-Caching=20bei=20localhost=20v?= =?utf8?q?erhindern?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Verhindert Probleme beim Debugging, indem bei Zugriff via localhost die aktuelle Unix-Zeit als GET-Parameter an die Stylesheet- und Icon-URLs angehängt wird. --- template.inc.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/template.inc.php b/template.inc.php index 6a949fb..7e1fcdb 100644 --- a/template.inc.php +++ b/template.inc.php @@ -28,6 +28,16 @@ $i = array_rand($search_placeholders); $placeholder = $search_placeholders[$i]; unset($i); + +/** + * Append Unix Time to CSS files to force reloading while debugging + */ +$css_query_string = ""; +if (in_array($_SERVER["REMOTE_ADDR"], array("::0", "127.0.0.1"))) { + $unixtime = date("U"); + $css_query_string = "?unixtime=" . $unixtime; +} + ?> "> @@ -46,13 +56,13 @@ unset($i); - - - - - + + + + + - " sizes="64x64"> + " sizes="64x64"> -- 2.30.2