Notes

Why video on WordPress belongs on a CDN

The fifth viewer buffers. A 600 MB video with ten people watching: served from the Media Library, six of the ten are buffering; served from the CDN edge, all ten are playing and the server is left serving pages, 60 GB lighter.

The short version

A ten-minute 1080p video is about 600 MB. Upload it to the Media Library and your web server has to send all of it, to every viewer, from one place, while also building pages for everyone else. It will do this badly.

A CDN moves that work somewhere built for it. For images it's a good idea. For video it's the difference between a page that plays and one that buffers.

What a CDN is

A CDN (content delivery network) is a set of servers spread around the world that keep copies of your files. When someone in Denver opens your page, the video comes from a server near Denver, not from your host in Virginia. The file travels a shorter distance, and your server never sees the request.

For an image that's a nice improvement. A 200 KB file arriving 80 ms sooner is real but hard to feel.

Video is a different scale. A viewer doesn't download a video once; the player pulls it in pieces for as long as they watch, and the pieces have to keep arriving faster than they're played. Any hiccup between the server and the viewer shows up as a spinner. Distance makes hiccups more likely, and a shared web server serving ten viewers at once makes them certain.

A page cache doesn't help here. Caching plugins save the finished HTML so WordPress doesn't rebuild it; the video file still comes from the server, in full, every time.

Why so many sites upload the MP4 anyway

Because WordPress lets you. Drag a file into the Media Library, drop a Video block on the page, and it plays. On the builder's laptop, on a quiet afternoon, it looks fine.

The other reasons are the same ones that keep images off a CDN:

  • Nobody told them. The hosting plan doesn't say "not for video," and the upload limit is the only warning they get.
  • It looks like infrastructure. Buckets, distributions, encoders, players. Easier to upload the file and move on.
  • They don't want another account. YouTube is the obvious alternative, and it comes with other people's ads, suggested videos, and a logo that isn't theirs. Vimeo and Wistia solve that, at a price that climbs fast.
  • Private video feels safer on their own server. It isn't, particularly, but the file being "here" feels like control.

The result is a site that works until the day it matters: a launch, a course with fifty students logging in at once, a video that gets shared.

Is a CDN still necessary?

For images, sometimes not. Hosting got faster, browsers got better at loading many files at once, and a light site with a nearby audience may not show a measurable difference. You can read the honest version of that argument in the B Side note.

For video the arithmetic doesn't leave room. One 600 MB video watched by 100 people is 60 GB out of your server. A typical shared hosting plan moves that much in a month, if it's allowed to at all, and does it while trying to serve every other page. Ten people watching at the same time on the same server is ten long-running downloads competing for one connection to the world. The fifth viewer buffers. The tenth gives up.

A CDN turns that into a hundred short local deliveries from servers that do nothing else, and your web server goes back to serving pages. There's no version of hosting video on a WordPress site where that trade isn't worth making.

Everything a CDN changes on a WordPress site

What the viewer notices

  • Video starts sooner and keeps playing. The pieces arrive from nearby, fast enough to stay ahead of playback. No spinner.
  • Images arrive sooner. The largest image on the page, the one Google measures as LCP, is the one that benefits most.
  • The site holds up under a spike. A launch, a share, a course cohort logging in together: the heavy files were never coming from the server, so the server barely notices.

What the server notices

  • Less CPU and bandwidth. Every video and image request the CDN answers is one your server doesn't. On a site with video, that's nearly all the bytes.
  • A smaller hosting plan holds up. The server does less, so you need less of it.
  • The disk stops filling up. A few videos in the Media Library will outweigh every image you've ever uploaded.

What you notice later

  • Backups shrink. A WordPress backup without 20 GB of MP4s is a quick download, not an overnight job.
  • Moving hosts gets easy. The media isn't on the server, so moving the site is the database and a few folders.
  • Media outlives the server. A hosting account that gets suspended, hacked or wiped doesn't take the videos with it.
  • Upload limits stop mattering. The hosting plan's upload cap was written for images. Video goes somewhere that expects it.

What a CDN alone doesn't do for video

A CDN delivers files. Put an MP4 on one and it will arrive faster, and that's a real improvement over the Media Library. But a video that plays well needs three more things a bucket and a CDN don't provide.

  1. Encoding. The file out of your camera or editor is far bigger than it needs to be for the web. A proper encode cuts it by half or more with no visible difference, which means less to deliver in the first place.
  2. Adaptive playback. The same video should play at a lower quality on a phone on cell data and at full quality on a desktop on fiber, and switch between them mid-stream when the connection changes. That means several encoded versions, sliced into segments, with a player that picks between them. This is what keeps a video from buffering, and it's not something a single MP4 can do.
  3. A player and an embed. Something that works in every browser, respects the page's layout, and doesn't advertise someone else's platform.

You can build all of that yourself on AWS. People do. It's a few weeks of work and a service to keep running afterward.

Where to start

For video, upload it to Stillhaven instead of the Media Library. It encodes the file, makes the adaptive versions, serves them through a CDN, and gives you an embed. The Stillhaven WordPress plugin adds a video block that previews the player in the editor and, with an API key, picks from your library, a shortcode for the Classic editor and page builders, and a Divi module. Paste a share link and it becomes the player. It also has a scan that lists every video embedded on the site, whoever hosts it, so you can see what you're working with before you move anything.

For images, put the Media Library on your own S3 bucket with CloudFront in front of it. Stowaway, a free plugin from the same shop, does that and keeps your original URLs working.

The rule is the same either way: the heavy files leave the server, and the server goes back to serving pages.

Stillhaven is private, ad-free video hosting for creators and small teams. See the plans, or read more notes.