1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Enabling gzip compression

Discussion in 'Server Configuration and Hosting' started by Puntocom, Jul 9, 2015.

  1. Puntocom

    Puntocom Well-Known Member

    Please, can you help me enabling gzip compression? I'm using nginx 1.7.10 with PHP 5.6.10 and I can't make it work for some files.

    From GTMetrix:
    Compressing the following resources with gzip could reduce their transfer size by 172.1KiB (67% reduction).
    Compressing https://example.com/js/xenforo/xenforo.js?_v=c6cba854 could save 110.6KiB (68% reduction).
    Compressing https://example.com/js/jquery/jquery-1.11.0.min.js could save 61.5KiB (65% reduction).
    Code in nginx.conf:
      gzip on;
      #gzip_disable "msie6";
      #gzip_vary on;
      # gzip_proxied expired no-cache no-store private auth;
      gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
    lib.output_compression = On
    a.tushkanov likes this.
  2. Nicky Vermeersch

    Nicky Vermeersch Active Member

    Are you using the spdy module for nginx? And this might sound retarded, but did you reload the service after you did the conf changes?
  3. Puntocom

    Puntocom Well-Known Member

    I'm not using SPDY. It's a pretty default config, only the mininum needed to work. Yes, I restarted it several times.
  4. DroidOne

    DroidOne Well-Known Member

    Maybe try adding: application/javascript
    a.tushkanov, maszd and Puntocom like this.
  5. Puntocom

    Puntocom Well-Known Member

    It works! thank you very much.
    DroidOne likes this.

Share This Page