Autoptimize Image Optimization to be less “lazy” with pictures

Up until now Autoptimize, when performing image optimization, relies on JS-based lazyloading (with the great lazysizes component) to differentiate between browser that support different image formats (AVIF, WebP and JPEG as fallback).

As JS-based Lazyload is going out of fashion though (with native lazyload being supported by more browsers and WordPress having out-of-the-box support for it too), it is time to start working on <picture> output in Autoptimize to serve “nextgen image formats” where different <source> tags offer the AVIF and WebP files and the <img> tag (which includes theĀ  loading=”lazy” attribute) with JPEG as fallback.

For now that functionality is in a separate “power-up”, available on Github. If you have Image Optimization active in Autoptimize (and you are on the Beta version, Autoptimize 2.8.1 is missing a filter which the power-up needs so download & install the Beta if not done yet), you can download the plugin Github and give it a go. All feedback is welcome!

1 thought on “Autoptimize Image Optimization to be less “lazy” with pictures

  1. frank Post author

    Just pushed an update to piggy-back on the lazyload exclusions field in AO + to also by default exclude any image that has “lazyload” in it or if the image is a revslider image (which makes it dangerous to mess with).

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.