Problem with gzip compression



  • Hi from Poland

    I’m new in this forum. I run shop with ThirtyBees 1.0.3 cms and Warehouse theme from IqitCommerce on VPS - koraledrewniane.pl

    Everything works great for me until i started my site seo optimization.

    All my CCC settings are turned on. The problem is when i run page analysis on gtmetrics.com. Google Speed score says to enable gzip compression on two files:
    http://koraledrewniane.pl/themes/warehouse/cache/v_57_e9e488e51b540995632eae9d70d0811b_all.css
    http://koraledrewniane.pl/themes/warehouse/cache/v_41_b77e132c440c69afc28f0a38b7a71ef1.js

    I have mod_deflate enabled on server.

    What can be wrong?



  • your nginx (reverse proxy?) server is probably not configured correctly. You can read more about this here.

    Note: If you use nginx in front of apache server then you don’t need to have mod_deflate enabled on apache at all. That will have negative impact on overall performance. Let nginx gzip this instead.



  • Thanks @datakick for the answear. I’ll read about that.



  • @datakick this is content of my nginx.conf file:
    #user nginx;

    worker_processes auto;
    pid /var/run/nginx.pid;

    #error_log logs/error.log;
    #error_log logs/error.log notice;
    #error_log logs/error.log info;

    events {
    include /etc/nginx/nginx-events.conf;
    }
    http {
    include /etc/nginx/mime.types;
    # For user configurations not maintained by DirectAdmin. Empty by default.
    include /etc/nginx/nginx-includes.conf;

    and my nginx-gzip.conf file:
    gzip on;
    gzip_static always;
    gzip_disable “msie6”;
    gzip_http_version 1.1;
    gzip_vary on;
    gzip_comp_level 8;
    gzip_proxied any;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js image/svg+xml;
    gzip_buffers 16 8k;
    gzip_min_lenght 256;

    Everything seems to be ok.



  • try to set gzip_http_version 1.0, or alternatively gzip_http_version 1.0 - this could help, according to this article



  • Setting gzip_http_version 1.0 doesn’t change anything, still the same problem.



  • I’ve just tried your configuration on my test server and it works just fine.

    Well, what strange is that there’s a typo in gzip_min_lenght that needed to be fixed first, otherwise nginx failed to restart. How come your server managed to restart with this typo in config file? Is the nginx-gzip.conf file actually included ? And did you actually restart nginx to reload settings?



  • Yes, there was a mistake. I had changed it to gzip_min_length and of course restarted nginx. Gtmetrix still show the same problem with compression.


  • administrators

    Do you use Plesk?



  • No, DirectAdmin, but i also have access by SSH.



  • The problem is solved.
    I forced my server administrator to resolve it. He removed this lines from .htaccess:

    <IfModule mod_deflate.c>
    	<IfModule mod_filter.c>
    		AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/x-javascript font/ttf application/x-font-ttf font/otf application/x-font-otf font/opentype
    	</IfModule>
    </IfModule>
    

    and add this:

    <IfModule mod_deflate.c>
        # compress html, css, javascript, text, xml and fonts
        AddOutputFilterByType DEFLATE application/javascript
        AddOutputFilterByType DEFLATE application/rss+xml
        AddOutputFilterByType DEFLATE application/x-font
        AddOutputFilterByType DEFLATE application/x-font-opentype
        AddOutputFilterByType DEFLATE application/x-font-otf
        AddOutputFilterByType DEFLATE application/x-font-truetype
        AddOutputFilterByType DEFLATE application/x-font-ttf
        AddOutputFilterByType DEFLATE application/x-javascript
        AddOutputFilterByType DEFLATE application/xhtml+xml
        AddOutputFilterByType DEFLATE application/xml
        AddOutputFilterByType DEFLATE font/opentype
        AddOutputFilterByType DEFLATE font/otf
        AddOutputFilterByType DEFLATE font/ttf
        AddOutputFilterByType DEFLATE image/svg+xml
        AddOutputFilterByType DEFLATE image/x-icon
        AddOutputFilterByType DEFLATE text/css
        AddOutputFilterByType DEFLATE text/html
        AddOutputFilterByType DEFLATE text/javascript
        AddOutputFilterByType DEFLATE text/plain
        AddOutputFilterByType DEFLATE text/xml
    
        # you can also compress by file type/extension:
        <files *.html>
            SetOutputFilter DEFLATE
        </files>
    </IfModule>
    

    I dont’t know why but it works.


Log in to reply
 

Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.