• Resolved frg

    (@frg)


    it works!
    it works!

    How to correct Minify&Gzip-errors with W3Total Cache W3TC 0.9.2.1
    (based on M. Nieberg′s
    https://kenntwas.de/2011/tips/tools-allgemein/english-version-wordpress-get-w3tc-0-9-2-1-running-with-minify-and-gzip-compression/ )

    *** make backups of:
    
    wp-content/plugins/w3-total-cache/lib/Minify/Minify/Controller/Base.php
        wp-content/w3tc/min/.htaccess
        root/.htaccess
    *** edit wp-content/plugins/w3-total-cache/lib/Minify/Minify/Controller/Base.php
    
    change  ,'encodeMethod' => 'zero'
    to      ,'encodeMethod' => 'gzip'   //MN: Was 'zero', set to gzip
    *** set in admin Performance->Minify->General: Rewrite URL structure ON
    *** set in admin Performance->Browser Cache->Cascading Style Sheets & JavaScript: Enable HTTP (gzip) compression ON
     (this updates to your root/.htaccess)
    *** edit wp-content/w3tc/min/.htaccess:
    (in "W3TC Minify core" part)
    
    change  RewriteRule ^w3tc_rewrite_test$ index.php?w3tc_rewrite_test=1 [L]
    to      RewriteRule ^w3tc_rewrite_test$ index.php?w3tc_rewrite_test=1 [QSA,L]
    
    add     ReWriteCond %{REQUEST_FILENAME} !^.+\.gzip$
    after   RewriteCond %{HTTP:Accept-Encoding} gzip 
    
    change  RewriteRule (.*) $1%{ENV:APPEND_EXT} [L]
    to      RewriteRule (.*) $1%{ENV:APPEND_EXT} [QSA,L]
    
    change  RewriteRule (.*) index.php?file=$1 [L]
    to      RewriteRule (.*) index.php?file=$1 [QSA,L]
    *** edit root/.htaccess:
    
    remove a lot (60?) of linefeds which W3TC put.
    
    (in "W3TC Page Cache core" part)
    change  RewriteRule ^(.*\/)?w3tc_rewrite_test$ $1?w3tc_rewrite_test=1 [L]
    to      RewriteRule ^(.*\/)?w3tc_rewrite_test$ $1?w3tc_rewrite_test=1 [QSA,L]
    
    ("BLOGSUB/" is the name of your WP subdirectory, is missing if installed in root)
    change
    RewriteRule .* "/BLOGSUB/wp-content/w3tc/pgcache/%{REQUEST_URI}/_index%{ENV:W3TC_UA}%{ENV:W3TC_REF}%{ENV:W3TC_SSL}.html%{ENV:W3TC_ENC}" [L]
    to
    RewriteRule .* "/BLOGSUB/wp-content/w3tc/pgcache/%{REQUEST_URI}/_index%{ENV:W3TC_UA}%{ENV:W3TC_REF}%{ENV:W3TC_SSL}.html%{ENV:W3TC_ENC}" [QSA,L]
    *** make both .htaccess files writeprotected by ftp:
    
    delete the write flags
    (doesnt work for me - i only get it down to 644 not 444)
    
    after i look in admin Performance, i got the two fleshy bars:
    Disk enhanced page caching is not active..auto install
    Minify is not active..auto install
    
    .. but i ignore them because my site works!
    
    minify & gzip is ok now!
    
    i know the changes will be overwritten if i change my W3TC settings again.

    https://www.ads-software.com/extend/plugins/w3-total-cache/

Viewing 8 replies - 16 through 23 (of 23 total)
  • Nick Davis

    (@esanctuary)

    Hi adamf/LucyRyder, having exactly the same issue here, everything working fine (with CDN/Cloudflare, then today hit the same problems) just wanted to subscribe in case of any useful follow-up posts

    If I find a solution in the meantime I’ll post it

    Nick Davis

    (@esanctuary)

    I’ve tried everything but in the end (for the moment at least) the only thing that fixed it, was not just deactivating but uninstalling and reinstalling W3 Total Cache

    Simple but seems to be OK for now (touch wood)

    Hope it helps someone

    adamf

    (@adamf)

    Hi Nickyboy,

    Thanks for your reply. Its a maddening issue. What did you do to unistall?

    Just delete the entire plugin or is there some special unistall procedure you did?

    Thanks.

    -Adam

    Nick Davis

    (@esanctuary)

    Hey Adam

    I just went to the Plugins menu, deactivated W3 Total Cache and then removed it, hope that makes sense? Let me know if not.

    I also uninstalled another W3 related plugin Admin Flush W3TC Cache, I don’t know if that had any effect but just to mention it as it may help you

    I realise everyone’s set up is different so what worked for me might not work for you but hope it’s some help, I feel your frustration!

    Cheers

    Nick

    On Ubuntu-11.10…

    W3TC is still broken in 0.9.2.4 for WordPress 3.2.1 and 3.3-beta3 as follows.

    ./lib/W3/Plugin/TotalCacheAdmin.php has a call to test_rewrite_minify() which
    in turn references …/wp-content/w3tc/min/ as a cache directory.

    The function test_rewrite looks for the cached object ‘w3tc_rewrite_test_%s’,
    creating it if required.

    Problem appears to be in get_transient() because if I camp on the entire wordpress
    install using inotifywait looking for any file containing w3tc_rewrite_test, no file is
    ever created.

    Rerunning /etc/cron.daily/mlocate then ‘locate w3tc_rewrite_test’ shows no file
    containing this string exists anywhere.

    So it appears the problem is inside test_rewrite() or get_transient().

    Unsure what to do next.

    Better for the Developer to release a fix.

    Hum… Directly fetching $domain/wordpress/wp-content/w3tc/min/ gives…

    There are all sorts of deprecated functions and other warnings.

    First I’ll clear all these up… including the deprecated functions access in WordPress (what’s that all about?) and retest.

    Once setting WP_DEBUG=true returns clean (no messages) I’ll start tracking this down again.

    I’m having the same problem on W3TC 0.9.2.4 and WordPress 3.3. I’m not clear — did the developer already incorporate the changes suggested by frg/martinlbb in a prior update (say, 0.9.2.2 or 0.9.2.3)?

    @david – Your post pointed me in the right direction. I too was getting the infuriating

    It appears Minify URL rewriting is not working.

    errors with 0.9.2.4 on a dev server.

    Turned out that I was using a self-signed SSL certificate which was causing the function test_rewrite to fail on line 5924 of ./lib/W3/Plugin/TotalCacheAdmin.php because w3_http_get($url) returned a wp_error object:

    object(WP_Error)#260 (2) { ["errors"]=> array(1) { ["http_request_failed"]=> array(1) { [0]=> string(146) "SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed" } } ["error_data"]=> array(0) { } }

    To fix either install a proper SSL cert or replace line 5294 with : $result = true;

    It’s not really a bug in w3tc, but would be nice to be able to disable these tests if we find that they are giving false negatives like in this case.

    Thanks Frederick for a great plugin. I know how much work is involved to maintain a plugin of this nature and truly appreciate your efforts.

Viewing 8 replies - 16 through 23 (of 23 total)
  • The topic ‘[Plugin: W3 Total Cache] How I got my W3TC working with minify & gzip’ is closed to new replies.