a tool for shared writing and social publishing

add cdn caching to feed routes

+3 -9
+1 -3
app/lish/[did]/[publication]/atom/route.ts
··· 7 7 params: Promise<{ publication: string; did: string }>; 8 8 }, 9 9 ) { 10 - let renderToReadableStream = await import("react-dom/server").then( 11 - (module) => module.renderToReadableStream, 12 - ); 13 10 const params = await props.params; 14 11 const did = decodeURIComponent(params.did); 15 12 const publication = decodeURIComponent(params.publication); ··· 22 19 return new Response(feed.atom1(), { 23 20 headers: { 24 21 "Content-Type": "application/atom+xml", 22 + "CDN-Cache-Control": "s-maxage=300, stale-while-revalidate=3600", 25 23 }, 26 24 }); 27 25 }
+1 -3
app/lish/[did]/[publication]/json/route.ts
··· 7 7 params: Promise<{ publication: string; did: string }>; 8 8 }, 9 9 ) { 10 - let renderToReadableStream = await import("react-dom/server").then( 11 - (module) => module.renderToReadableStream, 12 - ); 13 10 const params = await props.params; 14 11 const did = decodeURIComponent(params.did); 15 12 const publication = decodeURIComponent(params.publication); ··· 22 19 return new Response(feed.json1(), { 23 20 headers: { 24 21 "Content-Type": "application/feed+json", 22 + "CDN-Cache-Control": "s-maxage=300, stale-while-revalidate=3600", 25 23 }, 26 24 }); 27 25 }
+1 -3
app/lish/[did]/[publication]/rss/route.ts
··· 7 7 params: Promise<{ publication: string; did: string }>; 8 8 }, 9 9 ) { 10 - let renderToReadableStream = await import("react-dom/server").then( 11 - (module) => module.renderToReadableStream, 12 - ); 13 10 const params = await props.params; 14 11 const did = decodeURIComponent(params.did); 15 12 const publication = decodeURIComponent(params.publication); ··· 22 19 return new Response(feed.rss2(), { 23 20 headers: { 24 21 "Content-Type": "application/rss+xml", 22 + "CDN-Cache-Control": "s-maxage=300, stale-while-revalidate=3600", 25 23 }, 26 24 }); 27 25 }