• Resolved eraumavez78

    (@eraumavez78)


    Hello,
    Thanks in advance for your comments and suggestions.

    I am using WEBP images on my website, after a couple of days I found out: Safari users couldn’t view them, because Safari don’t support webp (images are missing!)

    So, I convert and upload jpg images on the same directory, but didn’t change my main pictures on my website (still webp).

    According to litespeed: “enabled webp replacement” should solve this issue, by removing webp. And from what I can see in the htaccess, litespeed should only serve the variation if browser supports webp. Not sure if this is a bug in the cache plugin or I’m missing something in my config?

    ### 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 ###

    Thanks for your comments
    era

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

    (@qtwrk)

    Hi,

    the rule you posted is out-dated already

    may I know what is your LSCWP version ?

    please try disable webp and then re-enable it , it should give you the new rules and please try how it goes

    ### 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]
    RewriteCond %{HTTP_USER_AGENT} iPhone.*Version/(\d{2}).*Safari
    RewriteCond %1 >13
    RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]
    ### marker WEBP end ###

    Best regards,

    Thread Starter eraumavez78

    (@eraumavez78)

    Hello Qtwrk,
    Thank you for your comment and support.

    I am using 3.5.2. Version.
    I don’t understand that code, I am “frontend user”, so most of the cases, I search, read and try previous solutions, so for that reason i used an old solution (without know it).

    Could you please tell me, how should be be renamed my files
    Options:
    Original >> Result without webp (Safari)
    1. filename.jpg.webp >> filename.jpg
    2. filename.webp >> filename.jpg

    What your this does “RewriteRule .* – [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]”

    Remove or add?

    Thanks for all
    Era

    @eraumavez78

    Safari supports webp images since version 14 of Safari. Version 14 has been released around 1 year ago, so if user report that they can’t see images they must have a very outdated version of Safari installed.

    Thread Starter eraumavez78

    (@eraumavez78)

    @serpentdriver

    Good to know it, I don’t own a MAC, and didn’t know it (about version 14)
    So maybe isn’t a big problem if all users update their browser!

    According to Wikipedia, Safari 14 was relased on June 22, 2020 and you must use macOS Big Sur (didn’t test it, just accordig to this source: https://caniuse.com/webp – “Partial support in Safari refers to being limited to macOS 11 Big Sur and later.”

    Thanks for your commments, and overview about this issue

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Yes , iPhone/iPad users generally have very much percentage on up-to-date version

    MacOS Big Sur is still on beta though

    if you still got issue , could you please post the .htaccess rule between

    ### marker WEBP start ###

    adn

    ### marker WEBP end ###

    Best regards,

    Thread Starter eraumavez78

    (@eraumavez78)

    @qtwrk

    1. Could you please tell me, how should be renamed my files
    Options:
    Original >> Result without webp (Safari)
    1. filename.jpg.webp >> filename.jpg
    2. filename.webp >> filename.jpg

    2. just ADN ?

    I tried it, and didn’t work
    And i also tried the first one.

    Thanks

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    1) why would you want to do this ?

    if you want to disable webp , just disable the option in setting

    2) do you use CDN ? if no CDN in use , I have a workaround for you

    Best regards,

    Thread Starter eraumavez78

    (@eraumavez78)

    @qtwrk
    Thanks for your comments and support.

    I want to keep using my webp files.
    The idea is to “distribute” just jpg to Safari users.

    I am using Cloudflare free account.

    1. Isnt’ possible to add a rule on Htaccess to rewrite or “redirect” my webp to jgp?
    2. I also read this, “if you are using Image WebP Replacement function, it will not add .webp if the browser does not support image/webp.” on https://wordpress.org/support/topic/webp-images-fallback/, but didn’t work or explain how should be renamed my webp.
    3. The “Varied image responses” can be a solution?

    Thanks

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Could you please tell me, how should be renamed my files
    Options:
    Original >> Result without webp (Safari)
    1. filename.jpg.webp >> filename.jpg
    2. filename.webp >> filename.jpg

    this won’t work that way, if you re-name both webp and origin to same file name , then you are back to your origin issue and safari will get webp if you do this , or chrome won’t get webo anymore.

    1) yes and no , that’s why I asked if you are using CDN

    when you use CDN , CDN node will cache the jpg/webp file , so your rewrite rule won’t be even in use.

    I understand your idea was like this :

    Chrome -> access *.jpg -> redirect to *.jpg.webp

    Safari -> access *.jpg -> keep it

    Safari -> access .*.jpg.webp -> *.jpg

    but , on second step , cloudflare will directly serve the file regardlessly it is webp or jpg , so the request doesn’t hit on your origin server for your rewrite rule to be used.

    as matter of fact, I have made that rule already , but it just won’t work with cloudflare or other CDN , currently I only know BunnyCDN can vary content on accept header

    2) it doesn’t rename anything , this is how LSCWP webp works

    when you do image opt , it will generates file like this

    image.bk.jpg -> this is backup file

    image.jpg -> origin file with optimization

    image.jpg.webp -> webp version

    by design , when browser sends “accept: image/webp” header , then server sends webp files , if this header not present , then don’t send webp

    3) not sure what is it ?

    Best regards,

    Thread Starter eraumavez78

    (@eraumavez78)

    @qtwrk
    Thanks for your comments and support,

    So,
    1. the solution is to avoid CDN, in my case cloudflare;
    2. The idea, was to access wepb (my default option) and to redirect safari users to same filename but without wepb
    So,
    filename1.png.wepb >> will be filename1.png on safari
    filename2.jpg.wepb >> will be filename1.jpg on safari

    3. The “Varied image responses” i think is the same, what you are doing.
    Source: https://github.com/rosell-dk/webp-express/blob/master/README.md

    “The “Varied image responses” method adds rules to the .htaccess which redirects jpegs and pngs to the corresponding webps (if they exist). The rules have a condition that makes sure they only trigger for browsers supports webp images (this is established by examining the “accept” header).

    There is another solution, do you think “Altering HTML to use picture tags” will work? [Same source – https://github.com/rosell-dk/webp-express/blob/master/README.md%5D

    Thankssssss

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    1) yes , currently as for CDN, I only know BunnyCDN can vary it , or CloudFlare with enterprise plan , but you know the price for CF enterprise…

    2) you don’t need to re-name it , LSCWP will search for .webp in that form

    image.bk.jpg -> this is backup file

    image.jpg -> origin file with optimization

    image.jpg.webp -> webp version

    3) it will end up SAME OUTCOME as I have mentioned about CDN service.

    the file is cached already on CDN , so whatever rewrite rule you put in your origin , it just will not be used at all

    4) picture tag , yes, it is the best solution , but unfortunately LSCWP doesn’t support that way as of now. 🙁

    Best regards,

    Thread Starter eraumavez78

    (@eraumavez78)

    @qtwrk ,

    Thank you for your comments and support.

    1. Do you know if quic.cloud can support it?
    2. I will do these steps, please correct me (if i am doing a mistake) or not using the smart procedures:
    2.1 Remove cloudflare (CDN), using direct acess – DONE!
    2.2 Upload all jpg and png? DONE!

    Next steps
    2.3 Change the entire website, because i have .webp images and i must replace all, to jpg and png.
    (I am trying to avoid this step).
    2.4 rename to old picture.webp to picture.jpg.webp
    2.5 In admin.php?page=litespeed-img_optm#settings
    Set Image WebP Replacement: ON

    Thanks, and i hope my details help others.
    Era

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    1) currently no , but this is on the to-do list.

    2) you do NOT need to 2.3 and 2.4 , if your webp is generated by LSCWP , LSCWP will keep

    image.bk.jpg -> this is backup file

    image.jpg -> origin file with optimization

    image.jpg.webp -> webp version

    this structure , webp will only be called by PHP when detects supported browser.

    were your webps generated by LSCWP ? or by other plugins ?

    do you see the files in structure as I mentioned ?

    Best regards,

    Thread Starter eraumavez78

    (@eraumavez78)

    @qtwrk

    I am not using any plugin to generate webp, I upload them by myself and woocommerce is using my webp directly not jpg or png. That is why i asked you about, if i must change it.

    Regards,

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    if you want to use LSCWP webp replacement , you just need to put the file in that structure

    Best regards,

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘WEBP Safari’ is closed to new replies.