tRPCttRPC
Powered by
mike_buildsM
tRPC•9mo ago•
5 replies
mike_builds

Caching a middleware response during batching

Hey there, I do some authorisation checks in middleware (procedure) - the authorisation check is a little bit slow. I'm facing an issue that when the page initially loads, there is a significant amount of TRPC requests sent as a batch and although it's sent as a batch, each path still runs the procedure.

Is there a way to cache the procedure response for the same request, or use the same procedure output for multiple requests during a batch?
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Caching API calls (HTTP response)
Answer OverflowAAnswer Overflow / ❓-help
2y ago
Use middleware to send response
OkanOOkan / ❓-help
4y ago
API Response caching not working on vercel ⁉
jaiJjai / ❓-help
4y ago