Next
Next

How to optimize images with next/image and AVIF on edge in Next.js?

November 28, 2025

Next.js next/image automatically generates AVIF/WebP formats with edge-optimized delivery via Vercel Image Optimization, reducing sizes 30-50%. Configure deviceSizes, imageSizes, and sizes prop for responsive loading; set priority for LCP images and fill for full-bleed. Edge caching serves from global CDN with <100ms TTFB.

Example:-

Code

import Image from 'next/image';

// Responsive hero
<Image
  src="/hero.jpg"
  alt="Hero image"
  width={1200}
  height={600}
  priority
  sizes="(max-width: 768px) 100vw, (max-width: 1200px) 90vw, 1200px"
  style={{ objectFit: 'cover' }}
/>

// Full viewport fill
<Image
  src="/background.jpg"
  alt="Background"
  fill
  sizes="100vw"
  className="object-cover"
/>
      
Hire Now!

Need Help with Next Development ?

Ready to leverage the power of conversational AI? Start your project with Zignuts expert AI developers.
bg-image
download-image
Company Deck
PDF, 3MB
© 2026 Zignuts Technolab. All Rights Reserved.
branch imagesbranch imagesbranch imagesbranch imagesbranch imagesbranch images