0

nginx 1.4.2

Google Pagespeed Insights (web version) is reporting that I should compress a number of .js files on my site.

I've checked the mime.types config file and it includes the default application/x-javascript js; directive. I've also verified through Firefox that the pages Insights reports as needing compression do present as application/x-javascript, yet according to Insights they don't appear to be being gzip'd.Also

I've also confirmed that nginx.conf has the following and that gzip is set to "on":

gzip_types  font/ttf font/opentype application/vnd.ms-fontobject image/svg+xml text/plain text/css image/png image/gif image/jpeg  text/xml application/xml application/x-javascript application/x ml+rss text/javascript;

Is there anything else I can try? gzip appears to be working fine on images and other assets it's just .js files that Insights isn't happy with.

Thanks,

Steve

steveharman
  • 3
  • 1
  • 2

1 Answers1

1

Check, if gzip options are enabled per virtual host. To enable css and js compression gzip_types application/x-javascript text/css text/plain; is enough. Also, make sure your files match gzip_min_length option.

Kewa
  • 154
  • 4