From 2c370dd4a6a7606289ff88929bcb620880db2012 Mon Sep 17 00:00:00 2001 From: Derin Owoade Date: Fri, 30 Dec 2022 12:39:15 +0100 Subject: [PATCH] adding caching --- pages/api/getStoreItems.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/api/getStoreItems.tsx b/pages/api/getStoreItems.tsx index 9a7af33..9bf1222 100644 --- a/pages/api/getStoreItems.tsx +++ b/pages/api/getStoreItems.tsx @@ -22,6 +22,7 @@ handler.get(async (req, res) => { const data = await ShopItem.find({ itemCollection: req.query.collection, }); + res.setHeader("Cache-control", "public, max-age=200"); return res.status(200).send(data); } catch (err) {} });