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

  • Can you post the related nginx config of that particular vhost? – Pothi Kalimuthu Sep 17 '13 at 14:40
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.