From 81bfeab4e0effa0407f0e87cff86009eab69e78f Mon Sep 17 00:00:00 2001 From: Jonas Kohl Date: Fri, 8 Nov 2024 11:54:01 +0100 Subject: Add cachebuster to files --- public/index.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'public') diff --git a/public/index.php b/public/index.php index 9de0c7d..a7f9674 100644 --- a/public/index.php +++ b/public/index.php @@ -31,6 +31,13 @@ function delTree($dir) { return rmdir($dir); } +function file_cachebuster(string $filename): string { + return htmlentities(urlencode(md5( + strval(filemtime($filename)) . + strval(filesize($filename)) + ))); +} + $defaultCode = <<Java - + "> - +