Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Most efficient way of disabling gzip for one specific file

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

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>