Dropped Vercel Build Time by 66% (5.5 Minutes to 1 Min 53 Seconds)

This contains some lessons I learned the hard way by maintaining a media-rich Next.js blog on Vercel for several years.

Initially, my focus was keeping the editing interface clean and fast: I like to work directly in MDX and I started out including images directly in my codebase. Over time, as I continued blogging, building demos and adding images and demo gifs to my site, build times started to climb.

Eventually I reached a point where my build was 5 minutes. I rolled up my sleeves and refactored my entire application:

  • Changing up static → ISR pages wherever possible
  • Migrating all images to Bunny CDN and replacing all references across my site
  • Optimizing my custom OpenGraph image integration to improve its efficiency.

Overall, I was able to drop my build times 66% - and I’m keen to get them down even lower. But 1 minute and 52 seconds is night and day from 5.5 minutes…

1 Like

Hi @zackproser, welcome to the Vercel Community!

Thanks for sharing this insightful blog post here. I’d also suggest to put some pointers or lessons in the post body so people can see a preview of what the blog contains and spark discussions here.

1 Like

Thanks for the suggestion, @anshumanb ! Done.

1 Like