TRPC cache (with vercel, but not working locally too)
Hello.
I am using TRPC to make a site which integrates with a third party API. I need to add caching to some of my routes.
I have tried to implement a temporary global cache, as seen below. In order to stop rate limits for the third party api.
However, the cache-control header does not get changed, and nothing is cached. Mutiple requests are still made to the third party API.
The
cache
code does run, as the console.log(2)
appears in console.
Any clue whats wrong?1 Reply
bump