Next.js fetch response does not indicate whether the data is cached or freshly fetched #80839
Unanswered
Melly5
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When logging the response of a fetch request in Next.js, we get the following information:
As shown, the only cache-related detail available is the caching strategy itself. However, in my case I need to determine whether the data is fresh — that is, whether this was a new request or a cached response. For example, I want to record performance metrics and measure the full request duration, but only when the data is retrieved from the origin and not served from cache.
similar topic, but doesn't have clear answer - #71662
Beta Was this translation helpful? Give feedback.
All reactions