diff --git a/app/api/pub_icon/route.ts b/app/api/pub_icon/route.ts index e893db11..30ccfbb5 100644 --- a/app/api/pub_icon/route.ts +++ b/app/api/pub_icon/route.ts @@ -104,14 +104,14 @@ export async function GET(req: NextRequest) { .webp({ quality: 90 }) .toBuffer(); - // Return with aggressive caching headers + // Return with caching headers return new NextResponse(resizedImage, { headers: { "Content-Type": "image/webp", - // Cache indefinitely on CDN, icons don't change + // Cache for 1 hour, but serve stale for much longer while revalidating "Cache-Control": - "public, max-age=31536000, immutable, s-maxage=31536000, stale-while-revalidate=604800", - "CDN-Cache-Control": "s-maxage=31536000, stale-while-revalidate=604800", + "public, max-age=3600, s-maxage=3600, stale-while-revalidate=2592000", + "CDN-Cache-Control": "s-maxage=3600, stale-while-revalidate=2592000", }, }); } catch (error) { diff --git a/components/Blocks/TextBlock/schema.ts b/components/Blocks/TextBlock/schema.ts index 37fcbccc..90c018b1 100644 --- a/components/Blocks/TextBlock/schema.ts +++ b/components/Blocks/TextBlock/schema.ts @@ -143,7 +143,9 @@ let baseSchema = { src: `/api/pub_icon?at_uri=${encodeURIComponent(node.attrs.atURI)}`, class: "inline-block w-4 h-4 rounded-full ml-1 align-text-bottom", - alt: "Publication icon", + alt: "", + width: "16", + height: "16", loading: "lazy", }, ],