a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

set cache-control headers instead of cdn-cache-control

+11 -3
+1 -1
app/api/atproto_images/route.ts
··· 24 24 // Set cache-control header to cache indefinitely 25 25 cachedResponse.headers.set( 26 26 "Cache-Control", 27 - "public, max-age=31536000, immutable", 27 + "public, max-age=31536000, immutable, s-maxage=86400, stale-while-revalidate=604800", 28 28 ); 29 29 cachedResponse.headers.set( 30 30 "CDN-Cache-Control",
+1
app/lish/[did]/[publication]/atom/route.ts
··· 19 19 return new Response(feed.atom1(), { 20 20 headers: { 21 21 "Content-Type": "application/atom+xml", 22 + "Cache-Control": "s-maxage=300, stale-while-revalidate=3600", 22 23 "CDN-Cache-Control": "s-maxage=300, stale-while-revalidate=3600", 23 24 }, 24 25 });
+2 -1
app/lish/[did]/[publication]/icon.ts
··· 59 59 headers: { 60 60 "Content-Type": "image/png", 61 61 "CDN-Cache-Control": "s-maxage=86400, stale-while-revalidate=86400", 62 - "Cache-Control": "public, max-age=3600", 62 + "Cache-Control": 63 + "public, max-age=3600, s-maxage=86400, stale-while-revalidate=86400", 63 64 }, 64 65 }); 65 66 } catch (e) {
+1
app/lish/[did]/[publication]/rss/route.ts
··· 19 19 return new Response(feed.rss2(), { 20 20 headers: { 21 21 "Content-Type": "application/rss+xml", 22 + "Cache-Control": "s-maxage=300, stale-while-revalidate=3600", 22 23 "CDN-Cache-Control": "s-maxage=300, stale-while-revalidate=3600", 23 24 }, 24 25 });
+6 -1
src/utils/getMicroLinkOgImage.ts
··· 20 20 }, 21 21 ); 22 22 const clonedResponse = response.clone(); 23 - if (clonedResponse.status == 200) 23 + if (clonedResponse.status == 200) { 24 24 clonedResponse.headers.set( 25 25 "CDN-Cache-Control", 26 26 "s-maxage=600, stale-while-revalidate=3600", 27 27 ); 28 + clonedResponse.headers.set( 29 + "Cache-Control", 30 + "s-maxage=600, stale-while-revalidate=3600", 31 + ); 32 + } 28 33 29 34 return clonedResponse; 30 35 }