psxP
tRPC•3y ago•
5 replies
psx

How can I make tRPC+NextJs APIs faster? (db and functions region is already same)

Hi, I have migrated my website backend (https://clubofcoders.com) from NestJs + Prisma + Cloud Run to tRPC + Prisma + NextJs serverless functions. But I am not quite happy with the performance (screenshot is attached).

The requests are taking up to five sec on first loads and 2/3 secs. afterward; I am using the same region for serverless functions and the database (planetscale). Hosted on vercel.

Any ideas I can improve this?
Screenshot_2023-04-06_at_11.01.29_PM.png
Join ClubOfCoders and learn full stack development, Next.js, Tailwind CSS, Firebase, Supabase, TRPC, Prisma, TypeScript, React, AWS and more
ClubOfCoders - Learn to build production ready websites
Was this page helpful?