apache / incubator-pagespeed-ngx

Automatic PageSpeed optimization module for Nginx
http://ngxpagespeed.com/
Apache License 2.0
4.37k stars 362 forks source link

Brotli image compression #1601

Open justinmayer opened 5 years ago

justinmayer commented 5 years ago

Now that the previous ngx-pagespeed-alpine repo has been moved here, I wanted to take this opportunity to hopefully re-kindle interest in facilitating integration of the ngx_brotli Brotli image compression module for Nginx with this repo's ngx-pagespeed-alpine Docker image. This was discussed this previously with @nberlee and @oschaaf, and it would be wonderful to see this endeavor get traction here under the Apache org's stewardship. 😊

jmarantz commented 5 years ago

I just want to cross-reference this with https://github.com/apache/incubator-pagespeed-mod/issues/1148 which has a lot more history and context.

One approach is to find configuration-based ways to integrate this with the existing support for brotli transcoding in a separate module, which seems straightforward and worth trying. Is that difficult for some reason?

Of course what I'd really like to see is a deep integration where PageSpeed stores brotli-compressed assets in its cache and serves them directly, rather than having to do the compression on the fly. This is based on the assumption that brotli compression would add significant latency and server load at scale, and that assumption may no longer be valid. Of course it depends on the compression level.

oschaaf commented 5 years ago

I, like Josh, would also like deep integration when thinking about Brotli. But in the context of the ngx-pagespeed-alpine image I would love it if we could offer a low friction and generic approach to including other modules (like ngx_brotli). But I am not sure what that would take. @nberlee do you have any thoughts on that?