Performance
AVIF at the edge: smaller images without the CPU bill
AVIF images are often 30% smaller than WebP, but encoding them is expensive. We share how we made on-the-fly AVIF practical.
Browser support for AVIF is now broad enough that serving it by default makes sense. The catch is encoding cost: a naive AVIF encode can take ten times longer than WebP.
Encode once, serve many
We encode each variant once at a regional shield and cache the result at the edge like any other object. The edge never encodes; it only negotiates the format from the Accept header.
Choosing the speed preset
We benchmarked every encoder speed setting against perceived quality using a panel of real product photos. Speed 7 gave us 94% of the size savings at a fifth of the CPU time of speed 4.
Numbers
Across customers who enabled format=auto, median image weight dropped by 31% compared with WebP and 52% compared with JPEG.