nystudio107 / nginx-craft

An Nginx virtual host configuration for Craft CMS that implements a number of best-practices.
MIT License
310 stars 36 forks source link

Brotli Compression #37

Open acalvino4 opened 2 years ago

acalvino4 commented 2 years ago

Is your feature request related to a problem? Please describe.

As Brotli compression has better performance than gzip and has 95% browser support now, it would be really nice to have it available in this config.

Describe alternatives you have considered

Obviously I can modify the config here to set it up myself, but since a lot of people use this config, I'm guessing it would be a welcome improvement to the base config here.

khalwat commented 2 years ago

Agreed. PRs are very welcome!

acalvino4 commented 2 years ago

@khalwat we are finally having some time to work on this - anything particular you would like to see in a PR? I was thinking we'd just add the brotli config options to compression.conf with similar settings to what is there for gzip. How does that sound?

acalvino4 commented 2 years ago

On second thought I am thinking we rename compression.conf to gzip.conf and add a separate brotli.conf so that people can selectively enable/disable brotli by changing the file extension to .off. This may be necessary for people who are not quite yet on the newest nginx version.