Skip to content



Optimizing usage on Vercel

Duration: 46:24

A Vercel community session where Jono answers live questions about optimizing usage: where the costs actually come from on Vercel, and the practical changes that keep image optimization, function invocations, and bandwidth spend under control.

Frequently asked questions

How do I work out what's actually causing high usage on Vercel?
Start with observability (and observability plus if you're on enterprise) and go after the low-hanging fruit. Look for the big spikes in function invocations: in the session, one slug had 2.3 million invocations while the next highest was 182K, with a 43.8% error rate because an external API's limits had been hit. Pair that with speed insights, where you focus on the poor scores rather than the good ones, because a badly performing page usually means too much data being fetched.
What's the single most important Next.js image setting for cutting image optimization costs?
The sizes prop on Next image. Jono's example is 100vw up to the 768px breakpoint, then a maximum of 512px, because most images sit in roughly half of a 1,024px container, and you don't need a 4K image for a 512px slot. Also set width and height (or fill) to kill cumulative layout shift, and put UIDs in your remotePatterns pathnames so nobody can maliciously optimise their entire image library through your quota.
What should I use for video on a Vercel site?
Just use Mux. It does for video what Next image does for images, delivering the most optimised version per screen size, and messing around with video codecs yourself is an absolute nightmare. If you're locked into Wistia or Vimeo you'll need a third-party player like React Player, which is maintained by Mux anyway. For background hero videos with no interaction, a stripped-back native player (like the one Roboto built) makes more sense than the full Mux player.
Should I chase a 100 out of 100 Lighthouse score?
No, and Jono says this as someone who built his agency's entire website for 100 out of 100. The team did everything to hit it and the experience would have been better if they'd just focused on videos feeling nice and images being crisp. The Mux website itself scores around 60 on Lighthouse but feels lightning fast in the real world, which shows the gap between emulated scores and real performance.
When should I use ISR instead of caching headers?
ISR wins on heavily nested websites, where an author name change might only need three pages rebuilding rather than a hundred. You only rebuild what you need, and the hard part is finding a clever way of invalidating just the routes that changed. Be careful though: if the site updates constantly, all that revalidation can rack up its own caching costs, and you may be better off doing certain things client side.
How can I check whether my Vercel caching is actually working?
Open the network tab, click the document request (the one named after your site), and look for the Vercel cache hit or miss header. For time to first byte, enable partial pre-rendering (on canary Next.js at the time of the session), which can drop TTFB into double-digit milliseconds, and read the actual payload of your fetches, because pulling a hundred full blog posts on one route will always be slow. Also make sure your servers are in the region closest to your users.
What's the most expensive mistake people make with Vercel usage?
Misusing "use client". Wrapping fetch requests or data-pulling effects in client components is where most of the quota gets blown, which is part of why Roboto avoids recommending libraries like Material UI that push you towards lots of use clients (Tailwind with Next.js instead). The other one is dumping huge images or videos in the public folder; keep that for light things like favicons and put heavy media in blob storage or something like the Mux integration.


Continue watching

Get in touch

Tell us what you're building. We reply within one working day. Jono or someone on the team picks up every message personally.

By sending this you agree to our privacy policy. We only use your details to reply.