fix favicon delivery and cache invalidation

This commit is contained in:
MOH
2026-03-07 19:19:58 +01:00
parent cd6ec7fa78
commit 3d1976a7a5
8 changed files with 193 additions and 7 deletions
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

+20
View File
@@ -0,0 +1,20 @@
import { NextResponse } from "next/server";
import { buildFallbackIconResponse, getDynamicSiteIconUrls } from "@/lib/site-icons";
export const dynamic = "force-dynamic";
export const revalidate = 0;
export async function GET() {
const iconUrls = await getDynamicSiteIconUrls();
if (iconUrls.faviconAssetUrl) {
const response = NextResponse.redirect(iconUrls.faviconAssetUrl, 307);
response.headers.set("Cache-Control", "no-store, max-age=0");
return response;
}
return buildFallbackIconResponse(iconUrls.siteName, 32);
}