Autoptimize with support for AVIF images

You probably have heard about AVIF already, but if not; it is a new image format which is based on the AV1 video format and generally has superior compression than the better-known WebP, JPEG, PNG and GIF formats. Avif is currently supported by Chrome & Opera and can be enabled by setting the image.avif.enabled flag in Firefox.

So now you know what it is you may want to use it on your WordPress site? In that case -and the title kind of gives it away- the freshly released Autoptimize 2.7.8 now has support for AVIF if you have image optimization active. Just as for WebP Autoptimize hooks into the lazyload JavaScript to detect if your visitor’s browser supports AVIF and will switch the requests to the ShortPixel CDN to that format if so. If AVIF is not support but WebP is, the requests will be for WebP images and if those are not supported old-fashioned JPEG’s will be loaded.

So there you have it, AVIF is now available in WordPress!

2 thoughts on “Autoptimize with support for AVIF images

  1. Grzegorz

    Why not use picture tag and specify source with avif, source with webp and fallback jpg? That would be easier than JS.
    And another issue is after this upgrade of AO I see more usage of my DB, especially temporary tables. Did you change anything with DB? Like doing more complicated queries with join etc?

    1. frankPost author

      Because I’ve seen some other plugin stumble when rewriting tags to + when doing webp & avif & jpeg on tags with sourceset/ sizes things get bloated & messy ;-)

      re. DB; no, AO does not do direct DB access (all is doing using normal WordPress options) and the amount of changes is actually pretty limited (see Github changelog)

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.