Compress JavaScript files with Gzip

Posted on March 17, 2015 at 11:30 pm

This is a list of JavaScript content-types:

text/js application/javascript application/x-javascript text/javascript

Example usage in /etc/nginx/nginx.conf file:

gzip on;
gzip_http_version 1.1;
gzip_comp_level 6;
# http://wiki.nginx.org/NginxHttpGzipModule#gzip_disable
gzip_disable "msie6";
gzip_proxied any;
gzip_types text/plain text/css text/xml text/js application/xml application/javascript application/x-javascript text/javascript application/json application/xml+rss;
gzip_buffers 16 8k;
gzip_vary on;

Updated on March 18, 2015 at 7:34 pm

Receive updates via email

Other Posts

Updated Posts