After enabling fetch logs in the next.config, I noticed that the cached result from API calls using the extended native fetch is always invalidated with the message: Cache skipped reason: (cache-control: no-cache (hard refresh)) when fetching any API endpoint from a page.
Bug Description
After enabling fetch logs in the
next.config
, I noticed that the cached result from API calls using the extended native fetch is always invalidated with the message:Cache skipped reason: (cache-control: no-cache (hard refresh))
when fetching any API endpoint from a page.I'm using
"next": "15.0.3"
with the app folder and followed the PostHog documentation on using the client.The result is always fresh when hitting the same endpoint multiple times:
However, it should be the cached result:
How to reproduce
next.config
.Additional context
posthog-node
package, the problem doesn't occur, but it's not possible to use session replays.layout
is a server component, so I can't import thePostHogPageView
usingdynamic
withssr: false
as stated in the documentation:import { PostHogClientProvider } from '@src/app/providers'
// irrelevant code