The Case for WebP and AVIF Images

A photographer comparing two identical photos on a monitor, one file far smaller

WebP and AVIF are modern image formats that usually make smaller files than JPEG and PNG at a similar visual quality. Smaller images mean fewer bytes for every visitor to download, which is why they are worth serving wherever you can. How much smaller depends on the picture and the settings used to make the copy, so measure your own pages rather than trusting a headline figure.

Why image formats matter for performance

Images are the heaviest assets on most web pages. Serving a lighter copy of the same picture is one of the few optimisations that needs no change to your content or your theme.

WebP supports lossy and lossless compression, transparency and animation, and current versions of the major browsers display it. AVIF is newer and can compress further still; current versions of Chrome, Edge, Firefox and Safari display it too. A browser that cannot display either format should still receive the original JPEG or PNG.

How to serve WebP and AVIF on WordPress

Two jobs are involved: making the copies, and getting each browser the right one.

  1. Make the copies. An image conversion plugin creates WebP and AVIF copies of your uploads, either as you upload them or in bulk for the existing library. Some CDNs can create them at the edge instead, which needs no plugin but does need a CDN plan that offers it.
  2. Serve the right copy. Each browser should get the newest format it supports, and every other browser the original. That has to hold on cached pages too: a page cached for one browser must never be handed to a browser that cannot show its images.

Caching Out Pro does the second job, and leaves the first to the converter you already trust for a whole library. When WebP and AVIF copies exist on your server, it gives each browser the newest format that browser announces, keeps a separate cached copy of the page for each format, and gives everyone else the original. It recognises the copies made by most conversion plugins, never uses a copy that is larger or older than its original, and never sends your images anywhere. For a single heavy image, Pro can also compress it on your own server and make its copies – one image at a time, with a before / after view and one-click restore. Safari supports both formats but does not announce them, so it may receive the original images.

Image formats and lazy loading

A lighter format makes each image smaller; lazy loading stops images below the fold from downloading until a visitor scrolls to them. The two act on different images and add up, which is why image-heavy pages such as product galleries gain the most from both.

Further reading: Lazy Loading Images: The Right Way, the companion technique for the images a visitor never scrolls to.

More from the blog

Ready when you are

One plugin, every optimisation, from $59 a year.

Install it, turn on what you need, and measure the difference on your own site. If it does not do what this site says, the 14-day guarantee means you get your money back.

  • No code required
  • Setup in under 3 minutes
  • 14-day money-back guarantee
  • 14-day money-back guarantee
  • Works on standard shared and managed hosting
  • Cancel anytime

Free edition · WordPress.org

Get Caching Out for free

Good call. Page caching is the biggest single speed win, and it is on the moment you activate. Two ways to install the free edition:

Option 2

Upload the zip

Download the plugin zip, then go to Plugins → Add New Plugin → Upload Plugin and choose the file.

Download free plugin (.zip)

After you activate, caching is already running. Open Caching Out → Setup Wizard to see what is on and why.

Want every feature from day one? Pro from $59/yr