1

I have an app that I'd like to optimize. After adding the following gzip config to Nginx I still get errors that the following files are not compressed and could save 400k in load.

Config:
# output compression saves bandwidth
  gzip  on;
  gzip_http_version 1.1;
  gzip_vary on;
  gzip_comp_level 6;
  gzip_proxied any;
  gzip_types text/plain text/html text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml;

  # make sure gzip does not lose large gzipped js or css files
  # see http://blog.leetsoft.com/2007/7/25/nginx-gzip-ssl
  gzip_buffers 16 8k;

  # Disable gzip for certain browsers.
  gzip_disable “MSIE [1-6].(?!.*SV1)”;

Files:
Compressing the following resources with gzip could reduce their transfer size by 445.6KiB (77% reduction).
Compressing https://cad.hcem.com/.../application-c58641bce5c2c94f380075bb5... could save 272.1KiB (73% reduction).
Compressing https://cad.hcem.com/.../application-99c35c4a0df5a19bfd5ed6938... could save 173.5KiB (84% reduction).

In my config I seem to have javascript already turned on for compression. Am I missing something that won't compress these files out of the pipeline?

4

1 に答える 1

0

#長いgzip_types行の前にa を置きます

そして追加

gzip_types
    # text/html is always compressed by HttpGzipModule
    text/css 
    text/javascript
    text/xml
    text/plain
    text/x-component
    application/javascript
    application/x-javascript
    application/json
    application/xml
    application/rss+xml
    font/truetype
    font/opentype
    application/vnd.ms-fontobject
    image/svg+xml;
于 2012-09-16T02:39:05.337 に答える