From 0d072ae29a1290a76f54535c3224a7e4b066fe05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Alexander=20Str=C3=B8mseng?= Date: Sat, 13 Apr 2024 23:55:28 +0200 Subject: [PATCH] add next caching for 24 hours (#287) --- frontend/src/components/SolarActivity/SolarData.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/components/SolarActivity/SolarData.tsx b/frontend/src/components/SolarActivity/SolarData.tsx index 181fab8..4c8990f 100644 --- a/frontend/src/components/SolarActivity/SolarData.tsx +++ b/frontend/src/components/SolarActivity/SolarData.tsx @@ -15,6 +15,11 @@ type SolarData = SolarDataEntry[]; async function getSolarData(): Promise { const res = await fetch( "https://services.swpc.noaa.gov/products/noaa-planetary-k-index-forecast.json", + { + next: { + revalidate: 60 * 60 * 24, // revalidate every 24 hours + }, + }, ); if (!res.ok) {