shando
Does `fetchRequestHandler()` automatically opt out of /app Route Handler caching?
I noticed that Next.js always skips cache for my TRPC API Route Handlers even though the request URLs are identical and the cache/revalidate config calls for persistent caching. I feel confident it has nothing to do with the
fetch()
calls within the Route Handlers as the same fetch()
calls are happening separately within SSR via createCaller()
and are being cached within Next's Data Cache as expected. However, I just read this from Route Handler docs:
You can opt out of caching by: Using the Request object with the GET method.And I see that
fetchRequestHandler()
takes in the Request
as a param:
Does fetchRequestHandler()
automatically opt out of /app Route Handler caching? And if so, is there a way to enable caching? Thanks in advance <:Sadge_pray:860473532700819506>2 replies