GZip not compressing everything

April 8, 2015 3.3k views
Nginx DigitalOcean


One of our client sites motionarray.com is reporting that 3 files aren't being compressed.


GZip is enabled on our server and we get a grade D for compression through YSlow so clearly some things are being compressed. I'm just stumped as to why these 3 files specifically aren't being.

Our nginx.conf contains this:

# Gzip Settings

gzip on;
gzip_disable "msie6";
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css;

Has anyone else experienced this?

3 Answers

if I download the file and compress it it compresses fine with nginx

here is my config

        gzip on;
        gzip_disable "MSIE [1-6]\.(?!.*SV1)";
        gzip_min_length  500;
        gzip_buffers  4 32k;
        gzip_types    text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml image/svg;
        gzip_vary on;

its basically the same as yours but we get different results.

My Server Result on Your File all.css

Yours all.css

it could be caused by the file size not meeting your requirements (default gzip reqs.)

  • Thanks for looking at this.

    I've just used your exact settings and get the same results my end. I'm really stumped with this.

    Don't think it's file size as the all.css file is only 145Kb.

Have you restarted nginx after making the changes to the configuration file?

sudo service nginx restart
  • I have yes. It's just ignoring those 3 files. Appears to be compressing others so I'm a bit stumped.

OK. Rebooting my droplet fixed the issue. Magic...

Have another answer? Share your knowledge.