Rabin R
Design Patternsintermediate

The facade pattern for heavy third-party embeds

Show a cheap placeholder and only mount the expensive widget on interaction — the same idea behind lite-youtube.

Introduction

A facade renders a lightweight stand-in (a poster image and a play button) and defers the real, heavy component until the user actually asks for it. It keeps hundreds of kilobytes of embed off the initial load.

I use exactly this in the portfolio's video player: until you click, there is no iframe in the DOM at all.