Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Gzip enabled - HTML compression Not working

Discussion in 'Workarounds and Optimization' started by podium84, Jul 24, 2018.

  1. podium84

    podium84 Registered

    Joined:
    Jul 23, 2018
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ibiza-spain
    cPanel Access Level:
    Website Owner
    Hi everybody!

    The HTMLS files from my website can not be compressed, JAva and CSS yes.
    From the server side they told me compression is enable. In OPtimize Web is active and I have "
    zlib.output_compression = On"

    I need some help because I´m geting crazy reading in the forums, talking with technical support of Hummingbird plugin fro WP and also with the hosting service.

    What is happening??
    Many thanks in advance for help with this.



    Alfredo
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,367
    Likes Received:
    1,857
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello Alfredo,

    Can you run the following command for an HTML page on the domain name and let us know the output?

    Code:
    curl -v --compressed http://domain.tld/test.html
    Ensure to use CODE tags and replace real domain names and IP addresses with examples when pasting the output in your response.

    Additionally, can you let us know the contents of your .htaccess file within the document root of the HTML files you are attempting to serve as compressed?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. podium84

    podium84 Registered

    Joined:
    Jul 23, 2018
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ibiza-spain
    cPanel Access Level:
    Website Owner
    Hi, I don´t know how to run a command in an HTML page... :( how can i do it, can u help please?
    THANKS!

    Htaccess content:
    Code:
    # BEGIN rlrssslReallySimpleSSL rsssl_version[3.0.2]
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTPS} !=on [NC]
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
    </IfModule>
    # END rlrssslReallySimpleSSL
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    
    
    
    <ifModule mod_gzip.c>
    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
    </ifModule>
    # BEGIN WP-HUMMINGBIRD-GZIP
    
    <IfModule mod_deflate.c>
        SetOutputFilter DEFLATE
        <IfModule mod_setenvif.c>
            <IfModule mod_headers.c>
                SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
                RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
            </IfModule>
        </IfModule>
        <IfModule mod_filter.c>
            AddOutputFilterByType DEFLATE "application/atom+xml" \
                                          "application/javascript" \
                                          "application/json" \
                                          "application/ld+json" \
                                          "application/manifest+json" \
                                          "application/rdf+xml" \
                                          "application/rss+xml" \
                                          "application/schema+json" \
                                          "application/vnd.geo+json" \
                                          "application/vnd.ms-fontobject" \
                                          "application/x-font-ttf" \
                                          "application/x-font-opentype" \
                                          "application/x-font-truetype" \
                                          "application/x-javascript" \
                                          "application/x-web-app-manifest+json" \
                                          "application/xhtml+xml" \
                                          "application/xml" \
                                          "font/eot" \
                                          "font/opentype" \
                                          "font/otf" \
                                          "image/bmp" \
                                          "image/svg+xml" \
                                          "image/vnd.microsoft.icon" \
                                          "image/x-icon" \
                                          "text/cache-manifest" \
                                          "text/css" \
                                          "text/html" \
                                          "text/javascript" \
                                          "text/plain" \
                                          "text/vcard" \
                                          "text/vnd.rim.location.xloc" \
                                          "text/vtt" \
                                          "text/x-component" \
                                          "text/x-cross-domain-policy" \
                                          "text/xml"
    
        </IfModule>
        <IfModule mod_mime.c>
            AddEncoding gzip              svgz
        </IfModule>
    
    </IfModule>
    # END WP-HUMMINGBIRD-GZIP
     
    #3 podium84, Jul 24, 2018
    Last edited by a moderator: Jul 24, 2018
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,367
    Likes Received:
    1,857
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You can run that command via SSH (if it's enabled on your account):

    SSH Access - Version 72 Documentation - cPanel Documentation

    As far as your .htaccess rules, you may want to try temporarily removing the custom mod_rewrite rules to rule them out as the cause of the issue. If the content is compressed after removing the custom mod_rewrite rules, then you'd want to check with the script developer to see how you might adjust those rules to ensure compression still works.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice