mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
perf: apply cachebuster to not found img and board banners
This commit is contained in:
@@ -8,7 +8,8 @@ const totalBanners = 57;
|
|||||||
const ImageBanner = () => {
|
const ImageBanner = () => {
|
||||||
const [imagePath] = useState(() => {
|
const [imagePath] = useState(() => {
|
||||||
const randomBannerIndex = Math.floor(Math.random() * totalBanners) + 1;
|
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='' />;
|
return <img src={imagePath} alt='' />;
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ const totalNotFoundImages = 2;
|
|||||||
const NotFoundImage = () => {
|
const NotFoundImage = () => {
|
||||||
const [imagePath] = useState(() => {
|
const [imagePath] = useState(() => {
|
||||||
const randomBannerIndex = Math.floor(Math.random() * totalNotFoundImages) + 1;
|
const randomBannerIndex = Math.floor(Math.random() * totalNotFoundImages) + 1;
|
||||||
return `assets/not-found/not-found-${randomBannerIndex}.jpg`;
|
const cacheBuster = new Date().getTime();
|
||||||
|
return `assets/not-found/not-found-${randomBannerIndex}.jpg?cacheBuster=${cacheBuster}`;
|
||||||
});
|
});
|
||||||
|
|
||||||
return <img src={imagePath} alt='' />;
|
return <img src={imagePath} alt='' />;
|
||||||
|
|||||||
Reference in New Issue
Block a user