fix favicon delivery and cache invalidation
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user