You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pagespeed.apache.org by GitBox <gi...@apache.org> on 2020/01/15 14:24:47 UTC
[GitHub] [incubator-pagespeed-mod] tomayac opened a new issue #1975: Only
serves Brotli when `Accept-Encoding` header demands it exclusively
tomayac opened a new issue #1975: Only serves Brotli when `Accept-Encoding` header demands it exclusively
URL: https://github.com/apache/incubator-pagespeed-mod/issues/1975
Chrome sends the following `Accept-Encoding` header: `accept-encoding: gzip, deflate, br`. This leads mod-pagespeed to serve `gzip` instead of `br`:
```bash
$ curl -I -s -H 'Accept-Encoding: gzip, deflate, br' https://blog.tomayac.com/css/main.css | grep content-encoding
content-encoding: gzip
```
However, when Brotli is requested *exclusively*, then `br` is correctly returned:
```bash
$ curl -I -s -H 'Accept-Encoding: br' https://blog.tomayac.com/css/main.css | grep content-encoding
content-encoding: br
```
Brotli should probably always be favored if the server *and* the client support it, even if for compatibility reasons other additional encoding formats are requested by the client.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-pagespeed-mod] tomayac closed issue #1975: Only serves
Brotli when `Accept-Encoding` header demands it exclusively
Posted by GitBox <gi...@apache.org>.
tomayac closed issue #1975: Only serves Brotli when `Accept-Encoding` header demands it exclusively
URL: https://github.com/apache/incubator-pagespeed-mod/issues/1975
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-pagespeed-mod] tomayac commented on issue #1975: Only
serves Brotli when `Accept-Encoding` header demands it exclusively
Posted by GitBox <gi...@apache.org>.
tomayac commented on issue #1975: Only serves Brotli when `Accept-Encoding` header demands it exclusively
URL: https://github.com/apache/incubator-pagespeed-mod/issues/1975#issuecomment-574687231
Thanks for the reply! I indeed have mod_brotli installed. What confuses me is that if I request https://blog.tomayac.com/static/sun.svg with `accept-encoding: gzip, deflate, br`, the server returns `br`. It may well be something with my server configuration, but I thought it was mod-pagespeed interfering.
If mod-pagespeed knows the server supports Brotli, could it then maybe rewrite the request header to remove `deflate` and `gzip` for commonly compressable resources?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-pagespeed-mod] jmarantz commented on issue #1975: Only
serves Brotli when `Accept-Encoding` header demands it exclusively
Posted by GitBox <gi...@apache.org>.
jmarantz commented on issue #1975: Only serves Brotli when `Accept-Encoding` header demands it exclusively
URL: https://github.com/apache/incubator-pagespeed-mod/issues/1975#issuecomment-574688887
That seems feasible for you to add your apache configuration without pagespeed? I know I've used some apache conf magic to do these sorts of conditional transformations, but it's been a while so I don't recall the syntax.
Just watch your server CPU time because at least in the past, Brotli was more time-consuming to compress on-the-fly than gzip. It might have improved since I looked carefully.
The reason I thought it would make sense for PageSpeed to support it directly is that PageSpeed could cache the compressed versions and serve those without re-compressing on the fly.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-pagespeed-mod] Lofesa commented on issue #1975: Only
serves Brotli when `Accept-Encoding` header demands it exclusively
Posted by GitBox <gi...@apache.org>.
Lofesa commented on issue #1975: Only serves Brotli when `Accept-Encoding` header demands it exclusively
URL: https://github.com/apache/incubator-pagespeed-mod/issues/1975#issuecomment-574752187
@tomayac What compression level have you enebled in the pagespedd config?
If you enable pagespeed compression then pagespeed stored the optimized resource gziped and serve it as gzip. By default pagespeed has enabled the compression to level 9, try to disable it:
ModPagespeedHttpCacheCompressionLevel 0
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-pagespeed-mod] jmarantz commented on issue #1975: Only
serves Brotli when `Accept-Encoding` header demands it exclusively
Posted by GitBox <gi...@apache.org>.
jmarantz commented on issue #1975: Only serves Brotli when `Accept-Encoding` header demands it exclusively
URL: https://github.com/apache/incubator-pagespeed-mod/issues/1975#issuecomment-574683832
PageSpeed does not currently have any support built in for automatically serving Brotli (although I agree that it should). https://github.com/apache/incubator-pagespeed-mod/issues/1148 tracks this.
There must be something else in your server-stack that's converting to Brotli (eg mod_brotli?).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-pagespeed-mod] tomayac commented on issue #1975: Only
serves Brotli when `Accept-Encoding` header demands it exclusively
Posted by GitBox <gi...@apache.org>.
tomayac commented on issue #1975: Only serves Brotli when `Accept-Encoding` header demands it exclusively
URL: https://github.com/apache/incubator-pagespeed-mod/issues/1975#issuecomment-575625539
Sorry for the radio silence, and thanks(!) for the answers!
> ModPagespeedHttpCacheCompressionLevel 0
Effectively disabling gzip with the above setting together with enabling the mod_brotli module on the server did the trick. Now everything is Brotli-compressed. 🎉
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services