Skip to content

Commit

Permalink
add next caching for 24 hours (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
Magnus Alexander Strømseng authored and GitHub committed Apr 13, 2024
1 parent 3a88955 commit 0d072ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frontend/src/components/SolarActivity/SolarData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ type SolarData = SolarDataEntry[];
async function getSolarData(): Promise<SolarData> {
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) {
Expand Down

0 comments on commit 0d072ae

Please sign in to comment.