new cache_buster function

This commit is contained in:
HB9HIL
2024-12-10 15:12:33 +01:00
parent eb2d38bae8
commit 8de3b1cf92

View File

@@ -32,4 +32,12 @@ class Paths
}
return $datadir . "/" . $path;
}
function cache_buster($filepath) {
$fullpath = $_SERVER['DOCUMENT_ROOT'] . $filepath;
if (file_exists($fullpath)) {
return base_url($filepath) . '?v=' . filemtime($fullpath);
}
return base_url($filepath);
}
}