Next.js extends the Web fetch() API to allow each request on the server to set its own persistent caching and revalidation semantics.
In production or for production build it is hard to debug and see how many requests are server from Redis cache or any cache if you are not running your app in Vercel. Only in dev mode Next.js exports logs about fetch events with cache status. Next.js does not expose “cache hit vs origin” for fetch() in a way APM monitoring can see by default. This could be possible if you can make it visible with custom APM labels / spans.
Ideas:
- Make adding event listeners possible for
get and set methods for createRedisHandler
- Add extra headers into responses from Redis what fetch can see, like
x-nextjs-cache-handler: HIT
Next.js extends the Web fetch() API to allow each request on the server to set its own persistent caching and revalidation semantics.
In production or for production build it is hard to debug and see how many requests are server from Redis cache or any cache if you are not running your app in Vercel. Only in dev mode Next.js exports logs about fetch events with cache status. Next.js does not expose “cache hit vs origin” for
fetch()in a way APM monitoring can see by default. This could be possible if you can make it visible with custom APM labels / spans.Ideas:
getandsetmethods forcreateRedisHandlerx-nextjs-cache-handler: HIT