Replies: 1 comment 3 replies
-
It's actually quite simple and it's a built-in feature in Next.js. You can enable it just by adding this logger to your Next.js config: const nextConfig = {
logging: {
fetches: {
fullUrl: true
}
}
}; The result will look something like this: | GET http://example.com/api/data 200 in 123ms (cache: MISS)
| GET http://example.com/api/data 200 in 5ms (cache: HIT) For requests that skip the cache, you might see:
Hope this was helpful! |
Beta Was this translation helpful? Give feedback.
3 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hello,
I need to know and log when a fetch() response came from cache.
How to check this ?
The Response status is still 200, cacheState is always an empty string and timingInfo is null !
the same in dev or build + start
Next v.14.2.2
Thanks
Djay
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions