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!

4 thoughts on “Autoptimize with support for AVIF images”

  1. 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?

    • Because I’ve seen some other plugin stumble when rewriting <img tags to <picture + when doing webp & avif & jpeg on <img 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)

  2. hey any way to get access to avif + webp WITHOUT using shortpixel cdn? we tried their cdn and used up the credits provided + a bunch that I purchased in like 30 minutes.

    • Not that I know of Kyle, there seems not to be broad support for AVIF at the image-optimizers-company’s yet. I did hear SP will change their pricing to be based on CDN usage instead of images optimized in the near future, so that might change credits usage?


Leave a Comment

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