• Resolved deeveearr

    (@deeveearr)


    I was going to check out Optimole before this plugin caught my eye – will this plugin work on a website with Litespeed Cache enabled?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hi @deeveearr,

    Thank you for your message.

    Yes, of course. We have many users who use LiteSpeed Cache. Please just remember not to activate the “Optimize Original Images” and “Image WebP Replacement” options in the LiteSpeed Cache plugin settings, because this generates a conflict – two plugins simply cannot optimize images.

    After installing the plugin, please clear the cache in LiteSpeed – it is best to do it this way:

    1. Log in to the management panel of your hosting.
    2. Find the “LiteSpeed Web Cache Manager” section.
    3. Click the “Flush All” button.

    Below I have attached the tutorial describing how to test the plugin:
    https://mattplugins.com/docs/how-to-test-converter-for-media-plugin

    If you have any other questions, please, feel free to reach out to me. We will try to help you.

    Best,
    Mateusz

    Thread Starter deeveearr

    (@deeveearr)

    Hi, @mateuszgbiorczyk – I’ve already added Optimole to one of my smaller websites (a one-pager) so that must be the reason that I cannot ‘test’ the site in that case.

    It’s one of my main ‘money’ websites that I was going to try this plugin out on.

    I’ve just ‘Bulk Optimized’ nearly 15,000 images from the money site – which plan would I need for Convertor for Media?

    I also see (in Optimole) that the plugin converts on the fly, to the best image format in respect of the browser being used. Does Convertor for Media do the same – as a few people might not be able to use AVIF images?

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    I’ve just ‘Bulk Optimized’ nearly 15,000 images from the money site – which plan would I need for Convertor for Media?

    One image in the limit means one conversion process (not one file in the Media Library). All files on the disk are counted (e.g. files from the /uploads directory). One image on disk uses two conversion processes from your limit because it is converted to both WebP and AVIF.

    All images you have on your website (on the disk) are counted along with any other sizes generated by WordPress. One image in the Media Library means several or more than a dozen files in the /uploads directory, because WordPress automatically generates additional files from one uploaded file, in different sizes.

    But I think a basic yearly plan will be sufficient. You can use the available limit freely throughout the year.

    I also see (in Optimole) that the plugin converts on the fly, to the best image format in respect of the browser being used. Does Convertor for Media do the same – as a few people might not be able to use AVIF images?

    Our plugin converts the images in advance and saves them in the /wp-content/uploads-webpc directory. The plugin does not change URLs to images, so when looking at the source of the website, you will see the URLs for the default images all the time. The plugin creates redirections to output files in WebP and AVIF format, changing the MIME type of these images, but without changing the URL.

    When a browser tries to download an image file, the plugin checks if it supports the AVIF format (if enabled in the plugin settings). If so, the browser will receive an equivalent of the original image in the AVIF format. If it does not support AVIF, but supports the WebP format, the browser will receive the equivalent of the original image in WebP format. In case the browser does not support either WebP or AVIF, the original image is loaded. This means full support for all browsers.

    Thread Starter deeveearr

    (@deeveearr)

    Hi @mateuszgbiorczyk – Right then, I’ll give it a go.

    Going to bed now, as its nearly 2am in the UK, but I’ll get in touch tomorrow.

    Thread Starter deeveearr

    (@deeveearr)

    Hi @mateuszgbiorczyk – I’ve added the plugin, but I have a server configuration error, and my hosting can’t add your code as its ngix – this is a Litespeed server:

    # BEGIN Converter for Media
    set $ext_avif ".avif";
    if ($http_accept !~* "image/avif") {
        set $ext_avif "";
    }
     
    set $ext_webp ".webp";
    if ($http_accept !~* "image/webp") {
        set $ext_webp "";
    }
     
    location ~ /wp-content/(?<path>.+)\.(?<ext>jpe?g|png|gif|webp)$ {
        add_header Vary Accept;
        add_header Cache-Control "private";
        expires 365d;
        try_files
            /wp-content/uploads-webpc/$path.$ext$ext_avif
            /wp-content/uploads-webpc/$path.$ext$ext_webp
            $uri =404;
    }
    # END Converter for Media

    Have you got an htaccess version?

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @deeveearr, please tell me what exactly your server configuration error is?

    Thread Starter deeveearr

    (@deeveearr)

    Hi @mateuszgbiorczyk – its this:

    It appears that your server uses the cache for HTTP requests. The rules from the .htaccess file or from the Nginx configuration are not executed every time when the image is loaded, but the last redirect from cache is performed.

    Followed by this:

    Please, contact your hosting support or CDN support and send them the following message:I have a problem with the cache for HTTP requests on my website – https://mywebsite.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 our instruction (https://url.mattplugins.com/converter-error-rewrites-cached-nginx-instruction) have been followed correctly

    Thread Starter deeveearr

    (@deeveearr)

    A quickie here, I just noticed on a blog post about this plugin, that it does not work with a CDN, If that’s correct, then Litespeed Cache’s Quik Cloud might be the problem?

    Thread Starter deeveearr

    (@deeveearr)

    Ok then @mateuszgbiorczyk – seeing as there’s nothing forthcoming, I’ll go over to Optimole.

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @deeveearr, can you give me your website URL? I will check it.

    Thread Starter deeveearr

    (@deeveearr)

    Hi @mateuszgbiorczyk

    Sure, but it’s NSFW and at https(colon-slash,slash)midlandsmaidens(dot)com

    Where you’ll see that SOME of the images are already webp but this is no doubt due to Litespeed Cache’s QuicCloud.

    Thread Starter deeveearr

    (@deeveearr)

    Ok then @mateuszgbiorczyk – my desicion is to go with my gut, and delete Convertor for Media and go with Optimole.

    I had enough errors with Shortpixel, and I just want an image optimizer that works and changes images to webp or AVIF with no input needed from the consumer, which Optimole apparently does.

    I’m just off to grab a coffee, so see you later, and byeee!

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @deeveearr, from what I can see, you are currently using a plugin that has changed the URLs from /wp-content/uploads/2024/05/example-image.jpg to /wp-content/uploads/2024/05/example-image.jpg.webp (this is an example, but the idea is to show that the file extension has changed). In my opinion, this is bad because it causes SEO losses. Search engines like Google index your images, and when the URLs change, this is problematic.

    On the home page you have 60 images from the /uploads directory. Less than 30 are available in WebP format, and the rest are in JPEG or PNG format. Your images were previously optimized, so the WebP format will not give you such effects. I suggest you think about the AVIF format. Images converted to the AVIF format on your website will weigh 35% less than images converted to WebP only, maintaining even better image quality.

    Additionally, this solution does not work well with website cache plugins. I accessed your website from a browser that does not support WebP, but I still received images in WebP format. That’s not how it’s supposed to work. In my opinion it should work like this:

    When a browser tries to load an image file, the plugin checks if it supports the AVIF format. If so, the browser will receive an equivalent of the original image in the AVIF format. If it does not support AVIF, but supports the WebP format, the browser will receive the equivalent of the original image in WebP format. In case the browser does not support either WebP or AVIF, the original image is loaded. This means full support for all browsers.

    As for the cache error for HTTP requests, it is probably QUIC.cloud Cache that does not support the Vary header sent by the user’s browser, this will pose a problem. Caching should be implemented not only based on the URL, but based on a combination of the URL and the Vary header value. Then there will be no problem with cross-browser compatibility.

    If you would like to configure our plugin in your environment, please, feel free to reach out to me.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Looks interesting,,,’ is closed to new replies.