• Resolved lponce

    (@lponce)


    Hello,

    I have a problem on one website. I have all the webp files generated on the server but none of them are served. I have checked the htaccess file and as I didn’t find any rewrite rule I copied this one :

    RewriteCond %{HTTP_ACCEPT} “image/webp”
    RewriteCond %{REQUEST_FILENAME}.webp -f
    RewriteRule ^(.*).(jpg|png|gif) $1.$2.webp [T=image/webp,L]

    The strange thing is that none of my browser shows webp images (safari and chrome).

    But when I am logged in to the wp-admin, the webp images load correctly.

    Thanks in advance for your help
    Laurent

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter lponce

    (@lponce)

    Just to let you know that “cache logged-in users” is activated

    Plugin Support qtwrk

    (@qtwrk)

    do you see files in your uploads direcotry with expected file name structure ? like something.jpg and something.jpg.webp ?

    try manually attach .webp to the individual image URI , make sure they are working first.

    and also please provide the report number , you can get it in toolbox -> report -> click “send to LiteSpeed”

    Thread Starter lponce

    (@lponce)

    Yes I can see the webp files in the uploads directory and they are accessible.

    As it’s really important I did some test yesterday. In your plugin there is an option to delete all the optimization data. I have done this yesterday, and the webp files were requested during the night. I was hoping that could solve the problem.

    I have the message : Image groups total: Congratulations, all requested!

    If I go to the media library I can see that there are still some files which don’t have the webp but most of them are generated. This seems normal as I have reached the daily limit of 500 files generated.

    But it’s still the same, none of the webp files are displayed.

    The strange thing is that if I log to the admin and display the website all the webp files are now correctly displayed.

    The report number is RHJPZHKO

    Thanks

    • This reply was modified 10 months, 2 weeks ago by lponce.
    Plugin Support qtwrk

    (@qtwrk)

    I can see quite some webps

    Thread Starter lponce

    (@lponce)

    Yes. That’s working now and most of the webp files are displayed. I don’t know what happened. Is there any delay between the fact that the webp file is generated and the fact it is managed by the cache ?

    One last question, how can I generate webp for the media files that still don’t have the webp file format ? Is it possible to push a specific media file to quic.cloud in order to generate the webp file ?

    When I go to the admin in image optimization, there’s no way to do manually an optimization request.

    Thanks

    Plugin Support qtwrk

    (@qtwrk)

    once image is pulled , the webp should work immediately

    you can’t , if you have finished all image optm and some image doesn’t have webp , that’s normal , some images may not get the webp

    Thread Starter lponce

    (@lponce)

    Thanks for your answer. The webp files appear on chrome but not in safari (Sonoma) which should display them. Could be maybe my htaccess snippet which is incorrect. Do you have some redirecting rules for webp files I could integrate in the htaccess file ?

    I don’t understand how litespeed chose the images in the media library and decide to convert in webp format or not. It’s quite mysterious as the images that don’t have the webp format are simple jpeg or png files.

    Thanks anyway for your help

    Plugin Support qtwrk

    (@qtwrk)

    modify (jpg|png|gif) to (jpg|jpeg|png|gif)

    Thread Starter lponce

    (@lponce)

    After a lot of trials and errors I managed to find the htaccess rules that work correctly. I mean webp files displayed on the browsers compatible with this format and jpeg, png files for the others. In case some people have problems with webp files like me here it is :

    <IfModule mod_rewrite.c>

    RewriteEngine On
    RewriteCond %{HTTP_ACCEPT} image/webp
    RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
    RewriteRule (.+).(jpe?g|png|gif)$ $1.webp [T=image/webp,E=REQUEST_image]

    </IfModule>

    <IfModule mod_rewrite.c>

    RewriteEngine On
    RewriteCond %{HTTP_ACCEPT} !image/webp RewriteCond %{DOCUMENT_ROOT}/$1.$2.webp -f
    RewriteRule (.*).(png|jpe?g|gif).webp$ $1.$2 [T=image/$2,L]

    </IfModule>

    <IfModule mod_headers.c>

    Vary Accept env=REQUEST_image

    </IfModule>

    <IfModule mod_mime.c>

    AddType image/webp .webp

    </IfModule>

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Problem with webp files’ is closed to new replies.