Support » Plugin: LiteSpeed Cache » Can’t get Image Webp Replacement to work

  • Resolved hemligg

    (@hemligg)


    We are running a Buddyboss community and are using LiteSpeed Cache plugin with its image optimatization. The optimization works fine but the webp images aren’t used even though I have enabled Image Webp Replacement.

    I have also checked the htaccess file and I see these lines of codes in there.

    ### marker WEBP start ###
    RewriteCond %{HTTP_ACCEPT} “image/webp” [or]
    RewriteCond %{HTTP_USER_AGENT} “Page Speed”
    RewriteRule .* – [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]
    ### marker WEBP end ###

    Still doesn’t work. No images are replaced whatsoever.

    What can be wrong?

    The page I need help with: [log in to see the link]

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    I noticed few things on your home page

    1. https://hemligg.se/wp-content/uploads/2020/06/hemligg_logo_beta_h96_white_transparent-1.png

    this image, doesn’t have webp file

    https://hemligg.se/wp-content/uploads/2020/06/hemligg_logo_beta_h96_white_transparent-1.png.webp gives you redirecion to login page

    2. some images are loaded via a plugin for watermark , this type of images can not be webp’ed

    3. some images are loaded by JS, currently LSCWP can only replace the images loaded by HTML , but may not be able to detect/replace the images loaded by JS/CSS

    Best regards,

    Thread Starter hemligg

    (@hemligg)

    Hm…okay. So it seems it is not creating webp-files for all images.

    If I for example have a look at the blog page:
    https://hemligg.se/blogg/
    And check out the image
    https://hemligg.se/wp-content/uploads/2020/08/fokus_tjejer_1600-1024×682.jpg
    there is no webp file created for that particular image.
    Each image on the site seems to be saved in different sizes.
    This particular image is saved in 6 different sizes beside the original image.
    And only one of them are saved as webp. The smallest one. :/
    https://hemligg.se/wp-content/uploads/2020/08/fokus_tjejer_1600-150×150.jpg.webp

    I assume it is LiteSpeed Image Optimization that saves the image in all these different sizes. There are no other image optimization enabled on the site what I know of.

    There is one plugin that watermark but it excludes this particular file and it doesn’t matter if I deactive that plugin. It still doesn’t work.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    LSCWP does not resize images, it only optimize the existing ones in your database.

    and if an image is not uploaded by Media page , like generate by other plugin , or uploaded directly via FTP/file manager …etc , LSCWP won’t be able to detect it and optimize it.

    Best regards,

    Thread Starter hemligg

    (@hemligg)

    Okay. It seems Buddyboss platform is saving each image in x number of sizes when image is uploaded to the media library.

    But when looking in the database the file saved in the database is https://hemligg.se/wp-content/uploads/2020/08/fokus_tjejer_1600.jpg

    But why is it the 150×150-version that gets a webp file created then? Shouldn’t it have been the original jpg file that is refered to in the database that would have had a webp file created for it?

    It still wouldn’t help the situation much though as we would need a webp-file created for each jpg-file in the uploads folder. And that will not be possible with LSCWP if I understand you correctly?

    Thread Starter hemligg

    (@hemligg)

    I was wrong. It was not Buddyboss platform that saved each uploaded image in x number of different sizes. It is wordpress itself. I just deactivated all plugins including buddyboss platform and it still created several different sizes.

    Shouldn’t LSCWP be able to handle this then?

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    please try reset this image in your Media page, then re-optimize it , and see if it can get webp files

    I have noticed in some cases, due to image format, color profile …etc bunch of weird things , LSCWP will fail to generate the webp.

    Best regards,

    Thread Starter hemligg

    (@hemligg)

    I tried that. Still only one webp-file created. The smallest thumbnail (150×150)

    This is what I find in debug.log about it:

    08/21/20 08:42:40.131 [119.666.666.666:11532 1 qJ0] 💓 ——POST HTTP/1.1 (HTTPS) /xmlrpc.php
    08/21/20 08:42:40.131 [119.666.666.666:11532 1 qJ0] Query String:
    08/21/20 08:42:40.354 [2a02:4780:8:a::17:29930 1 yG5] 💓 ——POST HTTP/1.1 (HTTPS) /wp-cron.php
    08/21/20 08:42:40.354 [2a02:4780:8:a::17:29930 1 yG5] Query String: doing_wp_cron=1597992160.2295210361480712890625
    08/21/20 08:42:40.354 [2a02:4780:8:a::17:29930 1 yG5] HTTP_REFERER: https://hemligg.se/wp-cron.php?doing_wp_cron=15966666666.229521036150625
    08/21/20 08:42:40.489 [2a02:4780:8:a::17:29930 1 yG5] [Router] get_role:
    08/21/20 08:42:40.506 [2a02:4780:8:a::17:29930 1 yG5] [Img_Optm] cron_pull running
    08/21/20 08:42:40.506 [2a02:4780:8:a::17:29930 1 yG5] [Img_Optm] Cron pull started
    08/21/20 08:42:40.703 [2a02:4780:8:a::17:29930 1 yG5] [Img_Optm] Pulled optimized img: /home/k826660988/domains/hemligg.se/public_html/wp-content/uploads/2020/08/fokus_tjejer_1600-150×150.jpg
    08/21/20 08:42:40.840 [2a02:4780:8:a::17:29930 1 yG5] [Img_Optm] Pulled optimized img WebP: /home/k826660988/domains/hemligg.se/public_html/wp-content/uploads/2020/08/fokus_tjejer_1600-150×150.jpg.webp
    08/21/20 08:42:40.937 [2a02:4780:8:a::17:29930 1 yG5] [Img_Optm] Pulled optimized img: /home/k826660988/domains/hemligg.se/public_html/wp-content/uploads/2020/07/anotherimage73-150×150.jpeg
    08/21/20 08:42:41.006 [2a02:4780:8:a::17:29930 1 yG5] [Img_Optm] Pulled optimized img WebP: /home/k826660988/domains/hemligg.se/public_html/wp-content/uploads/2020/07/anotherimage73-150×150.jpeg.webp
    08/21/20 08:42:41.061 [2a02:4780:8:a::17:29930 1 yG5] [Img_Optm] Pulled optimized img: /home/k826660988/domains/hemligg.se/public_html/wp-content/uploads/2020/07/anotherimage9fc-150×150.jpeg
    08/21/20 08:42:41.095 [2a02:4780:8:a::17:29930 1 yG5] [Img_Optm] Pulled optimized img WebP: /home/k826660988/domains/hemligg.se/public_html/wp-content/uploads/2020/07/anotherimage9fc-150×150.jpeg.webp
    08/21/20 08:42:41.098 [2a02:4780:8:a::17:29930 1 yG5] ❄️ posting to : https://node117.quic.cloud/img_optm
    08/21/20 08:42:41.191 [2a02:4780:8:a::17:29930 1 yG5] ❄️ posting to : https://node117.quic.cloud/img_optm
    08/21/20 08:42:41.282 [2a02:4780:8:a::17:29930 1 yG5] ❄️ posting to : https://node117.quic.cloud/img_optm
    08/21/20 08:42:41.299 [119.666.666.666:11532 1 qJ0] [Router] get_role:
    08/21/20 08:42:41.319 [119.666.666.666:11532 1 qJ0] [Ctrl] not cacheable before ctrl finalize
    08/21/20 08:42:41.319 [119.666.666.666:11532 1 qJ0] [Router] get_role:
    08/21/20 08:42:41.319 [119.666.666.666:11532 1 qJ0] [Vary] role id: failed, guest
    08/21/20 08:42:41.319 [119.666.666.666:11532 1 qJ0] [Router] get_role:
    08/21/20 08:42:41.319 [119.666.666.666:11532 1 qJ0] [Router] get_role:
    08/21/20 08:42:41.319 [119.666.666.666:11532 1 qJ0] [Optm] bypass: Not frontend HTML type
    08/21/20 08:42:41.319 [119.666.666.666:11532 1 qJ0] End response

    —–
    Don’t know if that makes any sense for you.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    if you repeatedly failed to get webp , then there are could be 2 reasons

    1. webp file is larger than original , so there is no point to keep it

    2. webp generation failed for some reason , like special image format, color profile …etc

    Could you please provide me this image in original status ? I would like to try as well.

    Best regards,

    Thread Starter hemligg

    (@hemligg)

    Well this behaviour is not just this image. It concerns all images on the site. There are no webp-files created for any other images than the 150×150-thumbnails.

    So I don’t think there is anything weird with this particular image. But if you want to try it out then you can get the original here:
    https://drive.google.com/file/d/1AmJ_ojSuYVsvoZoMkSrzDeRz9JMMZiPh/view?usp=sharing

    • This reply was modified 1 year, 3 months ago by hemligg.
    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    I see now

    curl https://hemligg.se/wp-content/uploads/2020/08/fokus_tjejer_1600.jpg -e hemligg.se -LI
    HTTP/1.1 301 Moved Permanently
    Date: Sat, 22 Aug 2020 14:04:21 GMT
    Content-Type: text/html
    Connection: keep-alive
    Set-Cookie: __cfduid=d0cd708f4eb97f53c0042ca0a7c6669eb1598105061; expires=Mon, 21-Sep-20 14:04:21 GMT; path=/; domain=.hemligg.se; HttpOnly; SameSite=Lax; Secure
    Location: https://hemligg.se/wp-content/plugins/wccp-pro/watermark.php?&src=/wp-content/uploads/2020/08/fokus_tjejer_1600.jpg&w=1
    X-Turbo-Charged-By: LiteSpeed
    Cache-Control: max-age=14400
    CF-Cache-Status: HIT
    Age: 146
    cf-request-id: 04b81521d400001ea5acad4200000001
    Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
    Server: cloudflare
    CF-RAY: 5c6d247c8dd31ea5-AMS

    you have watermark that messed up with operation.

    try disable that plugin and try again.

    Best regards,

    Thread Starter hemligg

    (@hemligg)

    Well I’ve tried to deactivate the watermark plugin and it didn’t help. I restore the image (fokus_tjejer_1600.jpg) from backup and rescanned. Still only the 150×150 that got a webp-file created. Now I did not purge all, but I assume that wouldn’t have changed anything that could given some other result?

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    yeah well , but you still seem have something blocked the request.

    root@test:~$ curl https://hemligg.se/wp-content/uploads/2020/08/fokus_tjejer_1600.jpg -e hemligg.se -LI
    HTTP/1.1 403 Forbidden
    Date: Sat, 22 Aug 2020 22:15:23 GMT
    Content-Type: text/html
    Connection: keep-alive
    Set-Cookie: __cfduid=df024b38d8e3a46dc18160011d617a9651598134523; expires=Mon, 21-Sep-20 22:15:23 GMT; path=/; domain=.hemligg.se; HttpOnly; SameSite=Lax; Secure
    Cache-Control: private, no-cache, no-store, must-revalidate, max-age=0
    Pragma: no-cache
    X-Turbo-Charged-By: LiteSpeed
    CF-Cache-Status: BYPASS
    cf-request-id: 04b9d6af7200001139fba94200000001
    Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
    Server: cloudflare
    CF-RAY: 5c6ff3c58c301139-MAD

    Please verify

    Best regards,

    Thread Starter hemligg

    (@hemligg)

    Well I activated the watermark plugin again since it didn’t seem to help. So if you tried request the file after I posted some minutes ago then it might be the watermark plugin again. I have deactivated it again now and will leave it deactivated for a while.
    I don’t want to deactivate it too long though as there are some other feature in that plugin that we need in place. The watermark thing isn’t a “must have”. But other features in that plugin are “must have”.

    • This reply was modified 1 year, 3 months ago by hemligg.
    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    could you please check your Slack message ?

    Best regards,

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Can’t get Image Webp Replacement to work’ is closed to new replies.