Richard
Richard

Reputation: 5101

How do I implement Brotli compression in Apache?

I read about Broli compression and thought I might as well look into supporting it.

A recent(ish) article that I read mentioned a .br file - so will it be as easy as putting an index.br file alongside my index.html file? Or will supporting it mean recompiling Apache?

Upvotes: 7

Views: 13233

Answers (3)

Joe
Joe

Reputation: 917

Update: Use the Apache mod_brotli.

If your Apache is older, my answer from 2016 might be of interest:


2016 answer:

You could use the Apache module brotli_module by kjdev which works well for me.

You might also want to check out the new mod_brotli patch from Apache as suggested by Aeyoun. I haven't tried it myself, though.

Upvotes: 4

Daniel
Daniel

Reputation: 4735

Support for Brotli was just added as mod_brotli in Apache trunk, making Apache the first web server with Brotli support. Give it some time and you’ll be able to just enable the Brotli output filter as you would gzip and deflate in Apache. If you’re impatient, you can use the third-party brotli_module as suggested by Joe; or cherry pick the new mod_brotli patch from trunk and apply it to your 2.4.x installation.

Upvotes: 4

Crami
Crami

Reputation: 416

Here is a quite nice guide how to add support for pre compressed static content to apache with fall-back to gzip

https://lyncd.com/2015/11/brotli-support-apache/

Upvotes: 5

Related Questions