a tool for shared writing and social publishing

caching and stuff

+7 -5
+4 -4
app/api/pub_icon/route.ts
··· 104 104 .webp({ quality: 90 }) 105 105 .toBuffer(); 106 106 107 - // Return with aggressive caching headers 107 + // Return with caching headers 108 108 return new NextResponse(resizedImage, { 109 109 headers: { 110 110 "Content-Type": "image/webp", 111 - // Cache indefinitely on CDN, icons don't change 111 + // Cache for 1 hour, but serve stale for much longer while revalidating 112 112 "Cache-Control": 113 - "public, max-age=31536000, immutable, s-maxage=31536000, stale-while-revalidate=604800", 114 - "CDN-Cache-Control": "s-maxage=31536000, stale-while-revalidate=604800", 113 + "public, max-age=3600, s-maxage=3600, stale-while-revalidate=2592000", 114 + "CDN-Cache-Control": "s-maxage=3600, stale-while-revalidate=2592000", 115 115 }, 116 116 }); 117 117 } catch (error) {
+3 -1
components/Blocks/TextBlock/schema.ts
··· 143 143 src: `/api/pub_icon?at_uri=${encodeURIComponent(node.attrs.atURI)}`, 144 144 class: 145 145 "inline-block w-4 h-4 rounded-full ml-1 align-text-bottom", 146 - alt: "Publication icon", 146 + alt: "", 147 + width: "16", 148 + height: "16", 147 149 loading: "lazy", 148 150 }, 149 151 ],