tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
29
pulls
pipelines
add cdn caching to feed routes
awarm.space
6 months ago
0313f1d5
814df97f
+3
-9
3 changed files
expand all
collapse all
unified
split
app
lish
[did]
[publication]
atom
route.ts
json
route.ts
rss
route.ts
+1
-3
app/lish/[did]/[publication]/atom/route.ts
···
7
7
params: Promise<{ publication: string; did: string }>;
8
8
},
9
9
) {
10
10
-
let renderToReadableStream = await import("react-dom/server").then(
11
11
-
(module) => module.renderToReadableStream,
12
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
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
10
-
let renderToReadableStream = await import("react-dom/server").then(
11
11
-
(module) => module.renderToReadableStream,
12
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
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
10
-
let renderToReadableStream = await import("react-dom/server").then(
11
11
-
(module) => module.renderToReadableStream,
12
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
22
+
"CDN-Cache-Control": "s-maxage=300, stale-while-revalidate=3600",
25
23
},
26
24
});
27
25
}