From 43f1fc3ce52e6ddd397853964c8868f2f4eee41d Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Sun, 13 Feb 2022 18:15:07 +0100
Subject: chore: improve RSS feed generation time

---
 src/pages/feed.json.tsx | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'src/pages/feed.json.tsx')

diff --git a/src/pages/feed.json.tsx b/src/pages/feed.json.tsx
index e113b46..9b2e510 100644
--- a/src/pages/feed.json.tsx
+++ b/src/pages/feed.json.tsx
@@ -7,6 +7,10 @@ export const getServerSideProps: GetServerSideProps = async ({ res }) => {
   const feed = await generateFeed();
 
   if (res) {
+    res.setHeader(
+      'Cache-Control',
+      'public, s-maxage=600, stale-while-revalidate=59'
+    );
     res.setHeader('Content-Type', 'application/json');
     res.write(`${feed.json1()}`);
     res.end();
-- 
cgit v1.2.3

