1
0

add cache buster

This commit is contained in:
Philip Wagner
2025-03-26 13:23:40 +01:00
parent 4e6b1d6a11
commit facfdcf97d
2 changed files with 11 additions and 2 deletions

View File

@@ -31,4 +31,13 @@ function randomBg(): string {
static $colors = ["#f1edeb", "#ff00ff", "#48bd8d", "#8200ff", "#ff6700"];
$a = array_rand($colors, 2);
return bg($colors[$a[0]], $colors[$a[1]]);
}
}
Kirby::plugin('cache/buster', [
'components' => [
'css' => function ($kirby, $url, $options) {
$hash = md5_file($url);
return "$url?$hash";
}
]
]);