Jump to content

Recommended Posts

I developed a server side script to check if the browser supports webp format images by checking the "image/webp" string in the accept request headers. The problem is that recent versions of Safari, even though they support Webp, they do not send the string "image/webp" in the headers. Why?? How can I check if the Safari browser supports webp??

Screenshot 2023-11-15 at 12.16.10.png

You can't. Not from PHP. But Safari on any Mac that's been updated in the last couple years will support it.

There are client-side options, if you really need to know.

Or you could just, you know, not serve WEBPs to Safari.

  • Like 1

@requinix thank you so much for your answer!

I know a client-side solution like this one, but that would mean blocking JavaScript which will delay the page rendering.

I want to serve WEBP images to Safari if supported. Maybe I could detect in PHP if the request was performed using Safari and its version to serve Webp images.

Thank you anyway 🙂

Edited by hebrerillo

According to https://caniuse.com/?search=webp safari has supported webp since November 2020 on Big Sur or above. I can't remember what OsX is on now, but again according to caniuse.com it's been completely supported since September 2022. You're probably OK to assume it's safe to use.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.