Support » Plugin: W3 Total Cache » How to create static Gzip for any files js or css

  • Resolved Mentik Yusmantara

    (@mentikyusmantara)


    I have a problem in server gzip compression, my hosting will fixed soon.

    So i think, the good idea to create gzip static for specific files (js or css) like page cache via w3tc or minify cache.
    And also this can reduce server computing resource, cause js or css not served dynamically

    How to do?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @mentikyusmantara,

    I am sorry about the issue you are having but this is not related to W3 Total Cache.
    Please contact your developer for more assistance on this.

    Thanks for your plugin, it’s not only plugin, but also framework.
    I learn a loot from your plugin.

    For almost 2 weeks my hosting can’t fix that until now, i can create static GZIP by using ur .htaccess in minify cache folder. I just modify small inline code and copy to my script folder and create gzip manually using 7z software.

    its work magically

    # BEGIN W3TC Minify cache
    <IfModule mod_mime.c>
        AddType text/css .css_gzip
        AddEncoding gzip .css_gzip
        AddType application/x-javascript .js_gzip
        AddEncoding gzip .js_gzip
    </IfModule>
    <IfModule mod_deflate.c>
        <IfModule mod_setenvif.c>
            SetEnvIfNoCase Request_URI \.css_gzip$ no-gzip
            SetEnvIfNoCase Request_URI \.js_gzip$ no-gzip
        </IfModule>
    </IfModule>
    <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresByType text/css M10713600
        ExpiresByType application/x-javascript M10713600
    </IfModule>
    <IfModule mod_headers.c>
        Header set Vary "Accept-Encoding"
    </IfModule>
    # END W3TC Minify cache
    # BEGIN W3TC Minify core
    <IfModule mod_rewrite.c>
        RewriteEngine On
        #my modify
        RewriteBase /wp-content/script/gzip/
        RewriteCond %{HTTP:Accept-Encoding} gzip
        RewriteRule .* - [E=APPEND_EXT:_gzip]
        RewriteCond %{REQUEST_FILENAME}%{ENV:APPEND_EXT} -F
        RewriteRule (.*) $1%{ENV:APPEND_EXT} [L]
        RewriteRule ^(.+\.(css|js))$ /index.php [L]
    </IfModule>
    # END W3TC Minify core

    Best Thanks W3TC you help me in every aspect of site optimization 🙂
    I can get the same compression ratio as before. When my hosting create bad performance in gzip, i stil can get best gzip performance 🙂 for my script file actually 🙂

    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @mentikyusmantara,

    ou are most welcome.
    We would really appreciate if you could take a minute and post a review here. This will help us to continue offering a top-notch product to users. Thank you for your help!

    My pleasure
    Best thanks for your support
    Friendly and fast respon 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.