Welcome! Log In Create A New Profile

Advanced

gzip_static module does not obey mime types

Matt Gadient
August 24, 2018 06:56AM
I've noticed for a while that when gzip_static is enabled it checks *every* file it serves for a .gz extension, not just the ones listed in the gzip_types. For example in a page with 1 html and 30 images you'll have 61 requests to the file system: 1 for the correct .html.gz file, 30 for the non-existent .png.gz files, and 30 for the .png files.

You can verify this on a running server that has gzip_static on, with "strace -p PID 2>&1 | grep gz" (where PID is an nginx worker's PID). Visit a page of the site that has images and you'll get a whole bunch of "-1 ENOENT (No such file or directory)" in the output attached to /var/www/website/image.png.gz files.

I am wondering if this is intentional or if it is a bug. Thanks for your time.


_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

gzip_static module does not obey mime types

Matt Gadient August 24, 2018 06:56AM

Re: gzip_static module does not obey mime types

Richard Stanway August 24, 2018 11:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 113
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready