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?
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?