Gzip, Brotli, and Browser Cache SetupNginx Example
Nginx Example
If your server uses Nginx, a server admin can review a standard setup like this:
nginx
nginx1gzip on;2gzip_vary on;3gzip_proxied any;4gzip_comp_level 5;5gzip_min_length 256;6gzip_types7text/plain8text/css9text/javascript10application/javascript11application/json12application/xml13image/svg+xml;1415location ~* \.(css|js|jpg|jpeg|png|gif|webp|svg|woff|woff2)$ {16expires 30d;17add_header Cache-Control "public, max-age=2592000, immutable";18}
If Brotli is available on the server, a typical admin-managed setup may look like this:
nginx
nginx1brotli on;2brotli_comp_level 5;3brotli_types text/plain text/css text/javascript application/javascript application/json application/xml image/svg+xml;
If you do not control Nginx directly, send the above examples to the host and ask them to apply equivalent server-side rules.
Continue reading