From ef873c3d7d36b480393513bc29b0bfd7bd87e3d2 Mon Sep 17 00:00:00 2001 From: Andrea Muttoni Date: Tue, 20 Feb 2024 11:59:16 +0100 Subject: [PATCH] cache control --- next.config.mjs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/next.config.mjs b/next.config.mjs index 4678774..0f082bf 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,4 +1,26 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {}; +const nextConfig = { + async headers() { + return [ + { + source: '/cast/*', + headers: [ + { + key: 'Cache-Control', + value: 's-maxage=999999, stale-while-revalidate=999999', + }, + { + key: 'CDN-Cache-Control', + value: 'max-age=999999', + }, + { + key: 'Vercel-CDN-Cache-Control', + value: 'max-age=999999' + } + ], + }, + ]; + }, +}; export default nextConfig;