Blog
Business

Serve large files without slowing your website

In 2011 I gave a simple tip: put large files such as videos and ebooks on another server so your website stays fast. The concern was fair. A page with heavy files can load slowly and make visitors download more data than necessary. Today the answer is more nuanced than moving everything off-site.

What must load immediately?

Start with the page itself. Does the visitor need the whole video before pressing play? Should a download begin automatically? Often it is better to show a clear description and button, then fetch the large file only when someone chooses it. That saves data and lets the main content appear sooner.

Reduce file sizes where you can without making them unusable. Choose an appropriate image format and a resolution suited to the screen. Efficient encoding matters for video. web.dev explains that smaller video files start sooner and use less network bandwidth. Check the result on a phone and a slower connection.

When should files live elsewhere?

For many downloads or videos, specialist storage or delivery can help. A CDN can serve files from distributed servers and reduce the load on your origin server. Yet an externally embedded file can still slow a page through scripts or a heavy player. Another host is not an automatic speed gain.

Measure where the delay occurs first. See which files are large, when they load and which parts of the page wait for them. Then choose storage, caching and playback behavior that fit how people use the site. My old tip was about protecting a small server. The lasting lesson is to deliver large media deliberately rather than sending them with every page by default.

— GijsDiscuss this article

Was this article useful?

Give it 1 to 5 stars.

4.8/5 · 20 ratings

Something to think about, now and then

Fresh ideas in your inbox.

New articles, lessons from my startups and projects I’m building. Only when there’s something worth sharing.