calcom / cal.com

Scheduling infrastructure for absolutely everyone.
https://cal.com
Other
32.55k stars 8.06k forks source link

[CAL-4701] Optimize getServerSideProps on booking page #17596

Open Udit-takkar opened 1 week ago

Udit-takkar commented 1 week ago

From Alex:- viewer.public.event shouldn’t ever return all members IMO, if members are needed use pagination of use members.list instead

From SyncLinear.com | CAL-4701

ilyador commented 3 days ago

@Udit-takkar are you referring to the getSSP of the BookerSeo component?

Udit-takkar commented 2 days ago

@ilyador For eg. files like apps/web/server/lib/[user]/[type]/getServerSideProps.ts have ssr.viewer.public.event.fetch API calls which fetches the event types along with all the team members. For big teams with thousands of members could slow down the booking page and a lot of times members are not required. so we would create another endpoint to fetch event types without all the un necessary data especially members

ilyador commented 14 hours ago

and a lot of times members are not required

In which cases?

When getting a normal user (pro) I don't get members from ssr.viewer.public.event.fetch. When I tried team/enterprise booking pages, they use prisma.team.findFirst in team/[slug]/[type]/getServerSideProps. Then const eventData = team.eventTypes[0];. Does this mean you only need the first team member to make the booking?