Setting up Brotli on Nginx or Phoenix



Setting up Brotli on Nginx or Phoenix

Setting up Brotli on Nginx or Phoenix

Follow me on Twitter to get more tips and tutorials! https://twitter.com/AlchemistCamp

More at: https://alchemist.camp/episodes/brotli-setup

Brotli is a relatively new compression format that has two big advantages over gzip. It’s faster at compressing things and it compresses them down to nearly ~25% smaller files!

Let’s set up our Nginx server to serve brotli compressed HTML, CSS, JS and JSON assets! If you’re running Phoenix, Rails, Django, Node or anything else behind an Nginx proxy, this setup should work for you.

A basic strategy is also covered for serving brotli compressed assets from a Phoenix server running directly on the server without anything proxying in front of it.

Comments are closed.