Hello,
we’ve noticed that the fetchOptions provided to API methods like fetchByFilter are currently only applied to the initial fetch call and are not propagated to any subsequent or internal requests.
const contentAreas = await remoteApi.fetchByFilter({
filters: [
{
field: "fsType",
operator: ComparisonQueryOperatorEnum.EQUALS,
value: "GCAPage",
},
],
fetchOptions: getCacheOption("cmsGlobalContentAreas") as RequestInit,
locale: input.lang,
});
In this case, we use a Next.js cache strategy via fetchOptions:
{ next: { revalidate: 300 } }
However, this setting only affects the first fetch. Any internal requests – such as those for resolving references – do not inherit these fetchOptions.
Feature Request:
It would be highly beneficial if the provided fetchOptions were automatically applied to all nested or recursive internal API calls. This would ensure consistent handling of caching strategies throughout the full API request chain.
https://nextjs.org/docs/app/api-reference/functions/fetch