diff --git a/src/api/customObservations.ts b/src/api/customObservations.ts index d669b1c..d7699eb 100644 --- a/src/api/customObservations.ts +++ b/src/api/customObservations.ts @@ -33,7 +33,7 @@ async function fetchObservations(): Promise { const res = await fetch( `${process.env.apiHost}/api/portal/fr/${process.env.portal}/custom-contribution-types/`, { - next: { revalidate: 60 * 60 }, + next: { revalidate: 5 * 60 }, headers: { Accept: 'application/json', }, @@ -49,7 +49,7 @@ async function fetchObservation(id: string): Promise { const res = await fetch( `${process.env.apiHost}/api/portal/fr/${process.env.portal}/custom-contribution-types/${id}`, { - next: { revalidate: 60 * 60 }, + next: { revalidate: 5 * 60 }, headers: { Accept: 'application/json', }, @@ -67,7 +67,7 @@ async function fetchObservationDetails( const res = await fetch( `${process.env.apiHost}/api/portal/fr/${process.env.portal}/custom-contribution-types/${id}/contributions`, { - next: { revalidate: 60 * 60 }, + next: { revalidate: 5 * 60 }, headers: { Accept: 'application/json', }, diff --git a/src/api/details.ts b/src/api/details.ts index eece1e3..7ca1922 100644 --- a/src/api/details.ts +++ b/src/api/details.ts @@ -2,7 +2,7 @@ import { getDetailsUrl } from './settings'; async function fetchDetails(url: string) { const res = await fetch(`${process.env.apiHost}${url}`, { - next: { revalidate: 60 * 60 }, + next: { revalidate: 5 * 60 }, headers: { Accept: 'application/json', }, diff --git a/src/api/geojson.ts b/src/api/geojson.ts index 5641140..6b583bf 100644 --- a/src/api/geojson.ts +++ b/src/api/geojson.ts @@ -2,7 +2,7 @@ import { GeoJSON } from 'geojson'; async function fetchGeoJSON(url: string) { const res = await fetch(`${process.env.apiHost}${url}`, { - next: { revalidate: 60 * 60 }, + next: { revalidate: 20 * 60 }, }); if (res.status < 200 || res.status > 299) { return null; diff --git a/src/api/observations.ts b/src/api/observations.ts index 27ec494..b4e9b76 100644 --- a/src/api/observations.ts +++ b/src/api/observations.ts @@ -10,7 +10,7 @@ async function fetchObservation() { const res = await fetch( `${process.env.apiHost}/api/portal/fr/${process.env.portal}/contributions/json_schema/`, { - next: { revalidate: 60 * 60 }, + next: { revalidate: 5 * 60 }, headers: { Accept: 'application/json', }, diff --git a/src/api/page.ts b/src/api/page.ts index b726609..997fb05 100644 --- a/src/api/page.ts +++ b/src/api/page.ts @@ -2,7 +2,7 @@ import { Menu, getMenuSettings } from './settings'; async function fetchDetails(url: string) { const res = await fetch(`${process.env.apiHost}${url}`, { - next: { revalidate: 60 * 60 }, + next: { revalidate: 5 * 60 }, headers: { Accept: 'application/json', }, diff --git a/src/api/poi.ts b/src/api/poi.ts index e0b13e9..c21a79a 100644 --- a/src/api/poi.ts +++ b/src/api/poi.ts @@ -23,7 +23,7 @@ async function fetchPois({ params }: FetchPoisProps = {}): Promise { headers: { Accept: 'application/json', }, - next: { revalidate: 60 * 60 }, + next: { revalidate: 5 * 60 }, }); if (res.status < 200 || res.status > 299) { return []; diff --git a/src/api/settings.ts b/src/api/settings.ts index 955e8eb..58487b4 100644 --- a/src/api/settings.ts +++ b/src/api/settings.ts @@ -158,7 +158,7 @@ export async function fetchSettings(): Promise { const res = await fetch( `${process.env.apiHost}/api/portal/fr/portal/${process.env.portal}/`, { - next: { revalidate: 60 * 60 }, + next: { revalidate: 5 * 60 }, headers: { Accept: 'application/json', }, diff --git a/src/api/stations.ts b/src/api/stations.ts index 3491982..e3ed615 100644 --- a/src/api/stations.ts +++ b/src/api/stations.ts @@ -25,7 +25,7 @@ async function fetchStations(): Promise { headers: { Accept: 'application/json', }, - next: { revalidate: 60 * 60 }, + next: { revalidate: 5 * 60 }, }); if (res.status < 200 || res.status > 299) { return []; @@ -39,7 +39,7 @@ async function fetchStation(id: number): Promise { headers: { Accept: 'application/json', }, - next: { revalidate: 60 * 60 }, + next: { revalidate: 5 * 60 }, }); if (res.status < 200 || res.status > 299) { return null; @@ -55,7 +55,7 @@ async function fetchStationObservations( headers: { Accept: 'application/json', }, - next: { revalidate: 60 * 60 }, + next: { revalidate: 5 * 60 }, }); if (res.status < 200 || res.status > 299) { return null;