Features Pricing Docs Blog Reviews
Get Plugin

Click-to-Play Video Embeds

Performance 3 min read Updated Aug 2026

A single YouTube or Vimeo embed can add more page weight than the rest of the page combined. xSpeed Cache replaces embeds with a lightweight click-to-play facade, so the real player loads only when a visitor presses play.

What this does

When the setting is on, xSpeed Cache swaps each YouTube and Vimeo iframe on your pages for a static preview — the video’s thumbnail with a play button on top. Nothing from the video platform loads at that point: no player JavaScript, no tracking, no iframe.

When a visitor clicks the preview, the real player loads and starts playing immediately. For a visitor who never presses play, the page never pays the cost of the player at all.

Why use it

Video players are among the heaviest third-party resources a page can carry — the YouTube player alone pulls in hundreds of kilobytes of JavaScript before anyone watches anything. Pages with an embed above the fold often fail Core Web Vitals purely because of the player.

A facade removes that cost from the initial load:

  • Less JavaScript up front — the player loads on demand, not on page load.
  • Faster LCP and lower TBT — the browser draws your content instead of initializing a video player.
  • Works with caching — the facade is plain HTML, so it is served from the page cache like everything else.

How to enable it

  1. Open the xSpeed Cache dashboard and go to Optimization → Media Optimization.
  2. Turn on Click-to-Play Video Embeds.
  3. Purge the cache so already-cached pages pick up the facade.
  4. Visit a page with an embed and confirm the thumbnail renders, then press play to confirm the player loads.

Good to know

  • The facade applies to YouTube and Vimeo embeds. Other iframes are untouched (lazy-loading still applies to them — see Lazy Loading Images, Iframes & Videos).
  • The first click both loads the player and starts playback, so visitors do not have to click twice.
  • Because no third-party code loads until the visitor interacts, the facade also delays the video platform’s cookies and tracking until playback starts.
  • Lazy Loading Images, Iframes & Videos
  • Deferring and Delaying JavaScript
  • Understanding Cache Hits