From 2f098f14291361d47621f2df9809c8efc13c0b4f Mon Sep 17 00:00:00 2001 From: r-freeman Date: Wed, 18 Jan 2023 20:30:40 +0000 Subject: [PATCH] Updated caching headers for spotify api route --- next.config.mjs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/next.config.mjs b/next.config.mjs index beff912..e84c099 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -25,6 +25,19 @@ const nextConfig = { } else { return [] } + }, + async headers() { + return [ + { + source: '/api/spotify/currently-playing', + headers: [ + { + key: "Cache-Control", + value: "s-maxage=1, stale-while-revalidate=59" + } + ] + } + ] } }