Support Brotli as an encoding scheme when client has Accept-Encoding #1148
Comments
👍 |
Current plan for this:
|
caching gzip-encoded resources is in with 1.10.33.0 and newer |
Brotli resource usage at level 10 should now be low enough that we'd be able to do this. On the other hand, @crowell's initial investigation suggests this is more work to integrate than we had thought (on our end), so we've needed to bump the priority down here some. |
Brotli 0.4.0 is out - https://github.com/google/brotli/releases Any plans to re-evaluate how 0.4.0 does with mod_pagespeed? |
Based on the numbers we've seen, Brotli is now in good enough shape we can We definitely want to do it and believe it will help by reducing network On Thursday, June 23, 2016, Ankit Arora notifications@github.com wrote:
|
Hello, Just wondering if Brotli support was ever managed? Would love to be able to serve brotli compressed files over gzip :) |
@timeassistant in case you are interested in a fallback, recent versions of httpd support Brotli out of the box (v2.4.26 and up). |
@GuillaumeRossolini thanks, I already have the brotli module enabled. I was just curious if pagespeed was able to use brotli aswell |
While we wait for native support (🙏 thanks in advance to everyone involved in this effort), I've just documented how to make the current PageSpeed work with Brotli. |
BRILLIANT! Found that page today, understood what the instructions were meant to achieve (always helpful for developers) and put it in place. Confirmed working (tested with Chrome & Firefox - looking for "content-encoding: br" in Response Headers for .css, .js etc). Such a freaking awesome discovery - thank you @tomayac |
Doesn't seem to be working in nginx. ( |
Hi |
I'm using the recommended settings:
I was also unable to set the |
Hi Sound strange. PageSpeed has nothing to do with the brotli module or even gzip. Only if Yes, header manipulation is an old question related on how nginx work (the order nginx processes modules).See. apache/incubator-pagespeed-ngx#906 and apache/incubator-pagespeed-ngx#1005 (comment) and you can use If you only enables image filters.... well there is a PageSpeed function that work when PageSpeed don´t fully optimize resources: IPRO (https://www.modpagespeed.com/doc/system#ipro), an on the fly optimization, and there is an other side that maybe considered, the rewrite level, by default (if you don´t set any other rewrite level) is corefilters, this enables a set of filters. See: https://www.modpagespeed.com/doc/config_filters.html#level. If you only need these filters you will and none of the others filters you need to set:
This only enable the filters you have explicitly set. And maybe you need some like:
to not permit the use of filters not explicitly enabled. P.S. Can you share any url to test it? |
Hm, I'm no longer able to reproduce the issue with the compression, maybe a cache related issue which cleared out today? Though I'm still facing the issue with not being able to set headers. I have
I'm mainly focused on the I did rebuild the module with the One workaround is to disable pagespeed before adding the headers, but that’s not the best solution. location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
add_header "" "";
}
location ~* \.(css|gif|ico|jpe?g|js|png|svg|json)$ {
pagespeed off;
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
} |
Yes, maybe a cache issue. If you change But this, InPlaceResourceOptimization, can change the headers. Me too, not sure if the role of POSITION_AUX=true is still valid with dynamic modules, but I have mentioned it to say is an issue related on how the order nginx modules works is related to how headers are modified. W/o a whole knowlwdge of your installation I cna´t help much more, but I can suggest some things:
or use LoadFromFile (See: https://www.modpagespeed.com/doc/domains#ModPagespeedLoadFromFile) |
I don't think you should need to flush the pagespeed cache when changing options. A hash of all the options are incorporated into the cache keys. However I think it might be that PageSpeed is overriding the brotli module and serving its own cached response. I am not sure how the pagespeed resource serving prioritizies against the nginx brotli module in the serving flow. |
Hi @jmarantz |
I think that makes sense. PageSpeed doesn't know anything about Brotli right now so if it is configured to cache gzipped content and send it to clients, the Brotli module may not want to unzip and then brotli-compress the resources on the fly. So you need to disable the PageSpeed feature to cache gzipped content to enable the Brotli module to do it's thing. It would be much better if PageSpeed could actually store Brotli-compressed assets in its cache. We had a design for this quite sometime back, but this never got implemented. |
See https://code.google.com/p/chromium/issues/detail?id=452335 which tracks Chrome support for Brotli in https.
Mozilla has already added support: https://bugzilla.mozilla.org/show_bug.cgi?id=366559
The text was updated successfully, but these errors were encountered: