incubator-pagespeed-mod icon indicating copy to clipboard operation
incubator-pagespeed-mod copied to clipboard

firefox 65 png and gif files do not convert to webp, though jpg does.

Open Lofesa opened this issue 6 years ago • 11 comments

Firefox 65.0 is here.... And is wepb capable. Pagespeed convert jpg files to webp ones..... but not png or gif. The same files in Chrome get converted to webp.

Lofesa avatar Feb 10 '19 12:02 Lofesa

With Firefox 66.0.2 none of the images get converted to webp, despite the browser send image/webp header

Lofesa avatar Apr 07 '19 11:04 Lofesa

Hello,

With Firefox 66.0.2 none of the images get converted to webp, despite the browser send image/webp header

The main changes are in default accept header value:

  • about:config network.http.accept.default seems to have been removed from default Firefox conf
  • default accept header have been changed from : text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 in Firefox 65 -a- to text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 in Firefox 66 -b-.

Therefore, in html embedded pictures are served as jpeg.

webp are embedded and delivered :

- a -
curl 'https://www.domain.tld/' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'

jpeg are embedded and delivered :

- b -
curl 'https://www.domain.tld/' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'

cf : https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation/List_of_default_Accept_values

A comment has been filled at this bug : https://bugzilla.mozilla.org/show_bug.cgi?id=1417463

Thanks,

Eric

Related to this :

  • https://developer.mozilla.org/fr/docs/Mozilla/Firefox/Releases/66#Networking

  • https://bugzilla.mozilla.org/show_bug.cgi?id=1417463

  • https://bugzilla.mozilla.org/show_bug.cgi?id=1532223

  • https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation/List_of_default_Accept_values

  • https://github.com/apache/incubator-pagespeed-mod/issues/978

  • https://github.com/apache/incubator-pagespeed-mod/blob/b4bf44cc56d8bbf17494c540dfb6ef20dfcf5073/pagespeed/kernel/http/user_agent_matcher.cc#L120

eldk avatar Apr 07 '19 15:04 eldk

Hi Thx you @eldk for the info

Lofesa avatar Apr 08 '19 11:04 Lofesa

https://bugzilla.mozilla.org/show_bug.cgi?id=1544231

eldk avatar May 01 '19 01:05 eldk

https://bugzilla.mozilla.org/show_bug.cgi?id=1544231

This bug at bugzilla seems to be abandoned

Lofesa avatar Oct 16 '19 19:10 Lofesa

Hello,

I've put a new comment. https://bugzilla.mozilla.org/show_bug.cgi?id=1544231

Maybe this will be followed.

Thanks,

eldk avatar Oct 18 '19 23:10 eldk

Maybe this can be closed as far as the issue is solved in the firefox land . https://hg.mozilla.org/integration/autoland/rev/0614c786ca70ef998274b1bcebbcd612a5d5d00a

Lofesa avatar Nov 06 '19 08:11 Lofesa

Hello,

I've tested with Firefox nightly (72) it's OK now for jpeg conversion to webp. But png and gif files do not convert to webp as it was before the Firefox 66 to 71 regression. So maybe we should let it open as it will be a ModPagespeed concern now ?

Thanks,

Eric

https://www.fxsitecompat.dev/en-CA/docs/2019/image-webp-has-been-added-to-default-http-accept-header/

eldk avatar Nov 09 '19 02:11 eldk

I´m testing Firefox nightly (73) and get some png (don´t use gif) not converted and others png converted to webp. My theory about that is that the issue is related to the alpha channel. I have found in the file: pagespeed/kernel/image/image_converter.cc this line so if the alpha channel is 0, the image is not converted. In other hand, in the file pagespeed/kernel/http/user_agent_matcher.cc there are a whitelist for UA with support for webp alpha. So maybe including some like "*Firefox/7*" to the white list may do the trick.

EDIT: adding "*Firefox/7*" to the whitelist works. Maybe we need to add Firefox 66,67,68,69,70,71,72 to the LegacyWebpWhitelist cause these browser support webp but don´t send accept: image/webp in headers. I have no tried with gif

EDIT 2: adding firefox versions to the LegacyWebpWhitelist don´t work, maybe sending accept: image/webp is needed.

Ping @oschaaf

Lofesa avatar Jan 04 '20 19:01 Lofesa

@eldk same thing with MS Edge. Can I use say that version 18 is webp capable, but don´t send accept: image/webp thus no convert to webp mages.

Lofesa avatar Jan 05 '20 10:01 Lofesa

Hello,

@eldk same thing with MS Edge. Can I use say that version 18 is webp capable, but don´t send accept: image/webp thus no convert to webp mages.

I think the next Edge release (15 january 2020), that is build on chromium, will have the good accept-header. That was the case last summer with Edge insider https://www.google.com/amp/s/www.theverge.com/platform/amp/2019/11/4/20942038/microsoft-edge-chromium-release-date-new-logo-features . I can't test it now, no windows device.

addon on 01/15/2020 :

https://blogs.windows.com/msedgedev/2020/01/15/upgrading-new-microsoft-edge-79-chromium/ https://docs.microsoft.com/en-us/microsoft-edge/web-platform/user-agent-string

Finally that was a request to a jpeg pictures with some Chromium Edge early release made in october 2019 :

[18/Oct/2019:14:12:20 +0200] "GET /somepicture.jpg.pagespeed.ic.EH0bMcKsU5rahAt9APR3.webp HTTP/2.0" 200 17116 "https://www.domain.tld/page.html" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.50 Safari/537.36 Edg/78.0.276.17" 357 17458

So, I think that this will be OK with Edg/79, no trace of this UA in my logs for the moment.

Eric

eldk avatar Jan 05 '20 12:01 eldk