New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't send webp to CriOS when there is no accept:image/webp #1256

Closed
jmarantz opened this Issue Jan 28, 2016 · 6 comments

Comments

Projects
None yet
3 participants
@jmarantz
Copy link
Contributor

jmarantz commented Jan 28, 2016

The latest Chrome on iOS, based on WKWebView, cannot render webp images, but mod_pagespeed sends them.

See http://blog.chromium.org/2016/01/a-faster-more-stable-chrome-on-ios.html

I confirmed that this browser also does not send accept:image/webp. If, in the future, webp is re-enabled in CriOS, it will likely send accept:image/webp again.

This is a workaround:

SetEnvIf User-Agent CriOS mps_disable_webp
RequestHeader set ModPagespeedFilters -convert_jpeg_to_webp env=mps_disable_webp

@jmarantz

This comment has been minimized.

Copy link
Contributor

jmarantz commented Jan 28, 2016

Note: a similar issue was found in #969

@jmarantz jmarantz assigned jmarantz and unassigned huibaolin Jan 28, 2016

@jeffkaufman

This comment has been minimized.

Copy link
Contributor

jeffkaufman commented Jan 28, 2016

At this point maybe we should switch to a simple "send webp if and only if we get accept:webp"?

@jmarantz

This comment has been minimized.

Copy link
Contributor

jmarantz commented Jan 28, 2016

I agree with that, but that's a larger change (assuming we still want to send webp to Android 4.0) and want to do that in a follow-up.

@huibaolin

This comment has been minimized.

Copy link
Contributor

huibaolin commented Jan 28, 2016

Android browser supports WebP since 4.0 but doesn't have WebP header. It
still has ~11% market share totally in mobile and tablet [1]. It's not
clear what is the portion of 4.0+ in this 11%, however most likely it's not
trivial.

[1]
https://www.netmarketshare.com/browser-market-share.aspx?qprid=2&qpcustomd=1

On Thu, Jan 28, 2016 at 10:41 AM, Joshua Marantz notifications@github.com
wrote:

I agree with that, but that's a larger change (assuming we still want to
send webp to Android 4.0) and want to do that in a follow-up.


Reply to this email directly or view it on GitHub
#1256 (comment)
.

@jmarantz

This comment has been minimized.

Copy link
Contributor

jmarantz commented Jan 28, 2016

It turns out we need to separately disable webp-lossless and webp-animated, so the full workaround is:

SetEnvIf User-Agent CriOS mps_disable_webp
RequestHeader set ModPagespeedFilters -convert_jpeg_to_webp,-convert_to_webp_lossless,-convert_to_webp_animated env=mps_disable_webp

@jmarantz jmarantz closed this in 23947d0 Jan 28, 2016

@jmarantz

This comment has been minimized.

Copy link
Contributor

jmarantz commented Jan 28, 2016

More detailed workaround information for nginx and apache. None of this will be needed once we have 23947d0 in a release.

Apache & mod_pagespeed 1.10:
# Temporary workaround for
# #1256
SetEnvIf User-Agent CriOS mps_disable_webp
RequestHeader set ModPagespeedFilters -convert_jpeg_to_webp,-convert_to_webp_lossless,-convert_to_webp_animated env=mps_disable_webp

Nginx & ngx_pagespeed 1.10:
http {
pagespeed ProcessScriptVariables on;
server {
set $disable_filters "";
if ($http_user_agent ~ CriOS) {
set $disable_filters "convert_jpeg_to_webp,convert_to_webp_lossless,convert_to_webp_animated";
}
pagespeed DisableFilters "$disable_filters";
}
}

In 1.9, there is no convert_to_webp_animated filter, and the nginx variable support is not present in PageSpeed so you have to completely disable webp until we get you a patch.

Apache & mod_pagespeed 1.9:
# Temporary workaround for
# #1256
SetEnvIf User-Agent CriOS mps_disable_webp
RequestHeader set ModPagespeedFilters -convert_jpeg_to_webp,-convert_to_webp_lossless env=mps_disable_webp

Nginx & ngx_pagespeed 1.9:
http {
pagespeed DisableFilters "convert_jpeg_to_webp,convert_to_webp_lossless";
}

jeffkaufman added a commit that referenced this issue Jan 29, 2016

jeffkaufman added a commit that referenced this issue Jan 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment