diff --git a/apps/site/app/[locale]/next-data/api-data/route.ts b/apps/site/app/[locale]/next-data/api-data/route.ts index ae07d205cdb11..849d93864de07 100644 --- a/apps/site/app/[locale]/next-data/api-data/route.ts +++ b/apps/site/app/[locale]/next-data/api-data/route.ts @@ -29,16 +29,14 @@ export const GET = async () => { const gitHubApiResponse = await fetch( getGitHubApiDocsUrl(versionWithPrefix), - { ...authorizationHeaders, cache: 'force-cache' } + authorizationHeaders ); return gitHubApiResponse.json().then((apiDocsFiles: Array) => { // maps over each api file and get the download_url, fetch the content and deflates it const mappedApiFiles = apiDocsFiles.map( async ({ name, path: filename, download_url }) => { - const apiFileResponse = await fetch(download_url, { - cache: 'force-cache', - }); + const apiFileResponse = await fetch(download_url); // Retrieves the content as a raw text string const source = await apiFileResponse.text(); diff --git a/apps/site/next-data/blogData.ts b/apps/site/next-data/blogData.ts index 186d04e50135a..0dd576f0e1171 100644 --- a/apps/site/next-data/blogData.ts +++ b/apps/site/next-data/blogData.ts @@ -25,10 +25,9 @@ const getBlogData = (cat: string, page?: number): Promise => { const fetchURL = `${NEXT_DATA_URL}blog-data/${cat}/${page ?? 0}`; - // When we're on RSC with Server capabilities we prefer using Next.js Data Fetching - // as this will load cached data from the server instead of generating data on the fly - // this is extremely useful for ISR and SSG as it will not generate this data on every request - return fetch(fetchURL, { cache: 'force-cache' }) + // This data cannot be cached because it is continuously updated. Caching it would lead to + // outdated information being shown to the user. + return fetch(fetchURL) .then(response => response.text()) .then(response => parseBlogDataResponse(response)); }; diff --git a/apps/site/next-data/releaseData.ts b/apps/site/next-data/releaseData.ts index b41d41729a9fd..25af64ef07d9c 100644 --- a/apps/site/next-data/releaseData.ts +++ b/apps/site/next-data/releaseData.ts @@ -19,12 +19,11 @@ const getReleaseData = (): Promise> => { const fetchURL = `${NEXT_DATA_URL}release-data`; - // When we're on RSC with Server capabilities we prefer using Next.js Data Fetching - // as this will load cached data from the server instead of generating data on the fly - // this is extremely useful for ISR and SSG as it will not generate this data on every request + // This data cannot be cached because it is continuously updated. Caching it would lead to + // outdated information being shown to the user. // Note: We do manual JSON.parse after response.text() to prevent React from throwing an Error // that does not provide a clear stack trace of which request is failing and what the JSON.parse error is - return fetch(fetchURL, { cache: 'force-cache' }) + return fetch(fetchURL) .then(response => response.text()) .then(JSON.parse); }; diff --git a/apps/site/next.calendar.mjs b/apps/site/next.calendar.mjs index 7bc915013de8a..d32b4f5af27c3 100644 --- a/apps/site/next.calendar.mjs +++ b/apps/site/next.calendar.mjs @@ -33,7 +33,7 @@ export const getCalendarEvents = async (calendarId = '', maxResults = 20) => { calendarQueryUrl.searchParams.append(key, value) ); - return fetch(calendarQueryUrl, { cache: 'force-cache' }) + return fetch(calendarQueryUrl) .then(response => response.json()) .then(calendar => calendar.items ?? []); };