Error while using converter of media plugin in Wordpress site

I have a problem with the cache for HTTP requests on my website - ‘shivanyahandicrafts[.]com’. This prevents JPEG or PNG files from being dynamically redirected to WebP or AVIF, depending on whether the browser supports the format. Here are potential sources of this issue:

  • the server or CDN server does not support the “Vary: Accept” HTTP header or handles it incorrectly (the cache for redirects should be based not only on the URL to the file, but also on the value of the Accept header sent by the browser)
  • the server or CDN server does not support the “Cache-Control: private” HTTP header or handles it incorrectly (this header should be able to disable caching for static files on the CDN server or proxy server)
  • the website is running on the Nginx server without support for .htaccess files and not all the steps described in the plugin FAQ (in the question: Configuration for Nginx) have been followed correctly

If your images are proxied by Cloudflare, you cannot count on your origin to dynamically convert images, unless you add a script to the HTML that will check for whether the visitor’s browser is compatible with the new format and swap the image format accordingly. If you’re on a paid plan, you can enable Polish, that will perform the conversion to WebP automatically whenever the browser is compatible (most are, some older iOS devices aren’t)

That’s correct for the Free Plan. Paid Plans users can make use of Vary for images · Cloudflare Cache (CDN) docs

Not correct. But the problem arises when the HTML is cached by a Page or Cache Rule, APO etc. The HTML requesting WebP/Avif images may be cached and will be served to any visitor, regardless of browser compatibility.

1 Like