Pre-compressed content usage config files

Closes #231
This commit is contained in:
Léo Colombaro 2019-05-16 22:57:57 +02:00
parent d7fc6c362d
commit 8db768bd61
No known key found for this signature in database
GPG Key ID: 687B480A6D4F735F
4 changed files with 31 additions and 7 deletions

View File

@ -63,9 +63,3 @@ gzip_types
text/vtt
text/x-component
text/x-cross-domain-policy;
# This should be turned on if you are going to have pre-compressed copies (.gz)
# of static files available. If not it should be left off as it will cause extra
# I/O for the check. It is best if you enable this in a `location` block for a
# specific directory, or on an individual `server` level.
# gzip_static on;

View File

@ -0,0 +1,17 @@
# ----------------------------------------------------------------------
# | Brotli pre-compressed content |
# ----------------------------------------------------------------------
# Serve brotli compressed files if they exist and if the client accepts brotli
# encoding.
#
# (!) To make this part relevant, you need to generate encoded files by your
# own. Enabling this part will not auto-generate brotlied files.
#
# Note that some clients (eg. browsers) require a secure connection to request
# brotli-compressed resources.
# https://www.chromestatus.com/feature/5420797577396224
#
# https://github.com/eustas/ngx_brotli/#brotli_static
brotli_static on;

View File

@ -0,0 +1,13 @@
# ----------------------------------------------------------------------
# | GZip pre-compressed content |
# ----------------------------------------------------------------------
# Serve gzip compressed files if they exist and if the client accepts gzip
# encoding.
#
# (!) To make this part relevant, you need to generate encoded files by your
# own. Enabling this part will not auto-generate gziped files.
#
# https://nginx.org/en/docs/http/ngx_http_gzip_static_module.html
gzip_static on;

View File

@ -25,6 +25,6 @@ server {
include h5bp/errors/custom_errors.conf;
location ~* /test-pre-gzip {
gzip_static on;
include h5bp/web_performance/pre-compressed_content_gzip.conf;
}
}