perf: apply cachebuster to not found img and board banners

This commit is contained in:
plebeius.eth
2024-05-06 22:08:49 +02:00
parent 0ead6775ae
commit 1f4213ae0b
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -8,7 +8,8 @@ const totalBanners = 57;
const ImageBanner = () => {
const [imagePath] = useState(() => {
const randomBannerIndex = Math.floor(Math.random() * totalBanners) + 1;
return `assets/banners/banner-${randomBannerIndex}.jpg`;
const cacheBuster = new Date().getTime();
return `assets/banners/banner-${randomBannerIndex}.jpg?cacheBuster=${cacheBuster}`;
});
return <img src={imagePath} alt='' />;