What are the best practices for hosting videos on Vercel?

When building your site on Vercel, you might want to add video assets. Videos can be an important part of your design or content marketing. However, large video files can often lead to excessive bandwidth usage.

For example, you might want a background image as the header on your marketing site.

<video width="320" height="240" loop autoPlay>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
An example auto-playing Video HTML element.

Video hosting solutions

You can store files with Vercel Blob, a frontend-friendly solution for storing files in the cloud.

import { put } from '@vercel/blob';
export async function POST(request: Request) {
const { searchParams } = new URL(request.url);
const filename = searchParams.get('filename');
const blob = await put(filename, request.body, {
access: 'public',
return Response.json(blob);
Vercel Blob enables you to programmatically upload video files.

You can also host video assets (like .mp4 and .gif files) on dedicated content platforms such as:

Third-party solutions may offer additional options to customize, compress, and transform your video files. It's important to ensure your videos are compressed and optimized regardless of the platform they're being hosted on.

What about images?

Vercel has built-in Image Optimization, which works with zero-configuration using the Next.js Image Component. We recommend using these solutions for optimal Core Web Vitals and performance.

For example, here's a background image using next/image (Demo):

import Image from 'next/image'
import ViewSource from '../components/view-source'
import { bgWrap, bgText } from '../styles.module.css'
const Background = () => (
<ViewSource pathname="pages/background.js" />
<div className={bgWrap}>
<p className={bgText}>
Image Component
<br />
as a Background
export default Background
An example background image using the Next.js Image component.

Couldn't find the guide you need?