Skip to content

Revalidate booking pages on updateProfile#7941

Merged
emrysal merged 1 commit intomainfrom
roae85/cal-1319-revalidate-booking-pages-isr-when
Mar 25, 2023
Merged

Revalidate booking pages on updateProfile#7941
emrysal merged 1 commit intomainfrom
roae85/cal-1319-revalidate-booking-pages-isr-when

Conversation

@roae
Copy link
Copy Markdown
Contributor

@roae roae commented Mar 25, 2023

What does this PR do?

Revalidate booking page cache when the user change personal or general settings

Fixes #7892

Environment: Staging(main branch) / Production

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

  • Change your name on profile settings
  • Visit the booking page of an event type, it should display your new name

@roae roae requested a review from a team March 25, 2023 01:37
@linear
Copy link
Copy Markdown

linear bot commented Mar 25, 2023

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
cal ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 25, 2023 at 1:38AM (UTC)
inkblot ✅ Ready (Inspect) Visit Preview Mar 25, 2023 at 1:38AM (UTC)
ui ✅ Ready (Inspect) Visit Preview Mar 25, 2023 at 1:38AM (UTC)

@github-actions
Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 233.06 KB (🟢 -166 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Fifty-nine Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/[user] 103.22 KB 336.29 KB 96.08% (🟢 -0.03%)
/[user]/[type] 91.68 KB 324.74 KB 92.78% (🟢 -0.03%)
/[user]/[type]/embed 91.71 KB 324.77 KB 92.79% (🟢 -0.03%)
/[user]/book 183.12 KB 416.19 KB 118.91% (🟢 -0.03%)
/[user]/embed 103.29 KB 336.35 KB 96.10% (🟢 -0.03%)
/apps 166.9 KB 399.97 KB 114.28% (🟢 -0.05%)
/apps/[slug] 190.63 KB 423.69 KB 121.05% (🟢 -0.04%)
/apps/[slug]/[...pages] 392.04 KB 625.11 KB 178.60% (🟢 -0.04%)
/apps/categories 151.8 KB 384.87 KB 109.96% (🟢 -0.04%)
/apps/categories/[category] 155.67 KB 388.73 KB 111.07% (🟢 -0.05%)
/apps/installed/[category] 196.77 KB 429.83 KB 122.81% (🟢 -0.05%)
/auth/setup 79.3 KB 312.37 KB 89.25% (🟢 -0.03%)
/availability 155.01 KB 388.08 KB 110.88% (🟢 -0.04%)
/availability/[schedule] 271.72 KB 504.78 KB 144.22% (🟢 -0.04%)
/availability/troubleshoot 152.49 KB 385.55 KB 110.16% (🟢 -0.04%)
/booking/[uid] 123.31 KB 356.37 KB 101.82% (🟢 -0.03%)
/bookings/[status] 272.15 KB 505.21 KB 144.35% (🟢 -0.05%)
/d/[link]/[slug] 91.32 KB 324.39 KB 92.68% (🟢 -0.03%)
/d/[link]/[slug]/embed 91.36 KB 324.42 KB 92.69% (🟢 -0.03%)
/d/[link]/book 182.78 KB 415.84 KB 118.81% (🟢 -0.03%)
/event-types 349.04 KB 582.11 KB 166.32% (🟢 -0.05%)
/event-types/[type] 382.1 KB 615.16 KB 175.76% (🟢 -0.04%)
/getting-started/[[...step]] 302.9 KB 535.97 KB 153.13% (+/- <0.01%)
/insights 385.97 KB 619.03 KB 176.87% (🟢 -0.05%)
/more 151.43 KB 384.49 KB 109.85% (🟢 -0.04%)
/payment/[uid] 60.63 KB 293.69 KB 83.91% (🟢 -0.03%)
/settings/admin 156.87 KB 389.93 KB 111.41% (🟢 -0.05%)
/settings/admin/apps 165.55 KB 398.62 KB 113.89% (🟢 -0.05%)
/settings/admin/apps/[category] 165.54 KB 398.6 KB 113.89% (🟢 -0.05%)
/settings/admin/impersonation 157.15 KB 390.21 KB 111.49% (🟢 -0.05%)
/settings/billing 156.98 KB 390.04 KB 111.44% (🟢 -0.05%)
/settings/developer/api-keys 186.13 KB 419.2 KB 119.77% (🟢 -0.05%)
/settings/developer/webhooks 159.47 KB 392.54 KB 112.15% (🟢 -0.04%)
/settings/developer/webhooks/[id] 190.32 KB 423.38 KB 120.97% (🟢 -0.05%)
/settings/developer/webhooks/new 190.18 KB 423.24 KB 120.93% (🟢 -0.05%)
/settings/my-account/appearance 170.95 KB 404.01 KB 115.43% (🟢 -0.04%)
/settings/my-account/calendars 191.17 KB 424.23 KB 121.21% (🟢 -0.05%)
/settings/my-account/conferencing 162.74 KB 395.81 KB 113.09% (🟢 -0.05%)
/settings/my-account/general 266.04 KB 499.11 KB 142.60% (🟢 -0.05%)
/settings/my-account/profile 274.03 KB 507.09 KB 144.88% (🟢 -0.04%)
/settings/security/impersonation 159.02 KB 392.08 KB 112.02% (🟢 -0.04%)
/settings/security/password 192.31 KB 425.38 KB 121.54% (🟢 -0.05%)
/settings/security/sso 166.71 KB 399.78 KB 114.22% (🟢 -0.04%)
/settings/security/two-factor-auth 161.47 KB 394.54 KB 112.72% (🟢 -0.04%)
/settings/teams 156.61 KB 389.68 KB 111.34% (🟢 -0.05%)
/settings/teams/[id]/appearance 170.97 KB 404.03 KB 115.44% (🟢 -0.05%)
/settings/teams/[id]/billing 156.85 KB 389.91 KB 111.40% (🟢 -0.04%)
/settings/teams/[id]/members 296.75 KB 529.82 KB 151.38% (🟢 -0.05%)
/settings/teams/[id]/profile 269.24 KB 502.3 KB 143.51% (🟢 -0.04%)
/settings/teams/[id]/sso 166.81 KB 399.87 KB 114.25% (🟢 -0.05%)
/settings/teams/new 92.57 KB 325.63 KB 93.04% (🟢 -0.03%)
/team/[slug] 105.77 KB 338.83 KB 96.81% (🟢 -0.03%)
/team/[slug]/[type] 91.33 KB 324.39 KB 92.68% (🟢 -0.03%)
/team/[slug]/[type]/embed 91.36 KB 324.42 KB 92.69% (🟢 -0.03%)
/team/[slug]/book 182.78 KB 415.84 KB 118.81% (🟢 -0.03%)
/team/[slug]/embed 105.83 KB 338.9 KB 96.83% (🟢 -0.03%)
/teams 151.65 KB 384.71 KB 109.92% (🟢 -0.04%)
/workflows 164.54 KB 397.61 KB 113.60% (🟢 -0.04%)
/workflows/[workflow] 293.74 KB 526.8 KB 150.51% (🟢 -0.04%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

Copy link
Copy Markdown
Contributor

@emrysal emrysal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, am wondering how this will integrate with the new booker in the bigger picture.

@emrysal emrysal merged commit 0365157 into main Mar 25, 2023
@emrysal emrysal deleted the roae85/cal-1319-revalidate-booking-pages-isr-when branch March 25, 2023 21:06
},
});
// waiting for this isn't needed
Promise.all(eventTypes.map((eventType) => res?.revalidate(`/${ctx.user.username}/${eventType.slug}`)))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can take some time theoretically. Is it possible that the serverless function stops execution midway because the response has already been sent?

Maybe we should have a before and after log to track that this works successfully everytime(I see an "after" log, we can just add a "before" log)

Also, we can have a whitelist of changes that impact booking pages to probably avoid, unnecessary revalidate calls in the system e.g. Password, session timeout and others' don't impact booking pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CAL-1319] Revalidate booking pages (ISR) when personal/general settings was updated

3 participants