NewSpark

Blog / One Image URL, Smaller Files: Automatic WebP and AVIF Delivery

One Image URL, Smaller Files: Automatic WebP and AVIF Delivery

· NewSpark

Images are usually the heaviest part of a web page. Modern formats can shrink them dramatically, but only if every browser is sent a format it understands. Letting the server choose solves that.

Why format matters

JPEG has served the web for decades. WebP and AVIF compress the same photograph into much smaller files at the same visual quality, which means faster pages and lower bandwidth bills.

A measured example

We tested a 3000 by 2000 pixel photograph resized to 800 pixels wide. At matched visual similarity (SSIM), the sizes were:

  • JPEG, maximum quality: 485 KB
  • JPEG, quality 85: 99 KB
  • WebP: 64 KB
  • AVIF: 60 KB

One URL, the right format

With format negotiation you do not publish separate files per format. Request an image with automatic format, and the server returns AVIF to browsers that accept it, WebP to those that do not, and JPEG as the fallback. PNG is kept for images that need transparency. Responses vary by the browser’s Accept header, so caches keep the versions apart.

Size and quality in the URL

Width, height, smart crop and quality can be set in the image address, so one original serves every layout. Automatic width can pick a size from the browser’s own hints when the page opts in. Requests are never upscaled and are bounded in size, which protects the server.

Checklist for your own site

  • Serve responsive sizes rather than one large image.
  • Use AVIF or WebP with a JPEG fallback.
  • Set explicit width and height to avoid layout shift.
  • Cache transformed images at your CDN.

NewSpark’s image resizer does this from the original in your library. Read what else changed this year.

Want faster image delivery?

We’ll show you the resizer on your own images.

Get a demo