Skip to content

perf: defer Vimeo embed until user clicks play#602

Open
akamabu wants to merge 2 commits into
tailcallhq:mainfrom
akamabu:perf/lazy-load-vimeo-homepage
Open

perf: defer Vimeo embed until user clicks play#602
akamabu wants to merge 2 commits into
tailcallhq:mainfrom
akamabu:perf/lazy-load-vimeo-homepage

Conversation

@akamabu
Copy link
Copy Markdown

@akamabu akamabu commented May 13, 2026

Summary

Defers the Vimeo iframe on the homepage until the user clicks the play button.

Problem

The Vimeo embed loads ~500 KB of third-party JS/CSS on every page visit, even when the user never watches the video. Lighthouse flags this as render-blocking resources and third-party code that limits performance.

Solution

Replace the always-rendered <iframe> with a click-to-play pattern:

  • Before click: shows the existing thumbnail (already set as CSS background-image on .video-container) with an SVG play button overlay
  • After click: mounts the <iframe> with autoplay=1 so playback starts immediately

No visual change before interaction. Cookie consent / DNT logic is preserved.

Lighthouse impact

  • Eliminates Vimeo JS/CSS from initial page load (render-blocking third-party resources)
  • Reduces total blocking time and improves LCP on mobile

Closes #217

@akamabu akamabu force-pushed the perf/lazy-load-vimeo-homepage branch from 61288f1 to da8fdb5 Compare May 13, 2026 06:43
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.

2 participants