Welcome! Log In Create A New Profile

Advanced

Most efficient way of disabling gzip for one specific file

Posted by axelsjo 
Most efficient way of disabling gzip for one specific file
January 18, 2015 09:19AM
I want to enable gzip for all files in a server block except for one specific file (track.php) which will have a lot of POST requests.

What is most performant of the two following?

# ALTERNATIVE 1:
location ~ ^/(?!track.php) {
gzip on;
gzip_types text/plain text/xml [and a bunch of other];
}
# ALTERNATIVE 2:
gzip on;
gzip_types text/plain text/xml [and a bunch of other];
location = /track.php) {
gzip off;
}

I assume alternative 2 will be most efficient as long as the actual gzipping is not done until nginx has evaluated the whole server block?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 294
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