Forum Replies Created

Viewing 6 replies - 16 through 21 (of 21 total)
  • First thing you should do is take a look at the code where the error comes from.

    $exs->push(new FilesystemOperationException(
    	sprintf(__('The Page Cache add-in file advanced-cache.php is not a W3 Total Cache drop-in.
    	It should be removed. %s', 'w3-total-cache'),
    	w3tc_button_link(__('Yes, remove it for me', 'w3-total-cache'), wp_nonce_url($remove_url,'w3tc')))));
    return;

    It appears that you have some file in your cache that W3TC does not like and it want’s to ask you if you want it removed, so it’s trying to load the w3tc_button_link but it can’t find that function.

    You could try two thing. Completely clear all of your cache (even ones that were created by other plugins) so that there are no files that w3tc does not like. Then try to reinstall, most likely that will work.

    Or you could require the file where the button function is located. Place the require code just before the button function is called. Most likely that will work, but perhaps there are other functions that are also missing. It would look like this:

    require_once(W3TC_DIR.'/inc/functions/other.php');
    $exs->push(new FilesystemOperationException(
    	sprintf(__('The Page Cache add-in file advanced-cache.php is not a W3 Total Cache drop-in.
    	It should be removed. %s', 'w3-total-cache'),
    	w3tc_button_link(__('Yes, remove it for me', 'w3-total-cache'), wp_nonce_url($remove_url,'w3tc')))));
    return;

    Craig

    Hello,

    I use x-cache on a couple of sites but not any WP. Normally I don’t think it’s a good idea to use x-cache for cached files, I would just use the W3TC enhanced disk storage method and let Apache just serve them out directly, no php involved. That option might be disabled because x-cache would not store them anyway because there is no php.

    Just let x-cache process the WP php files because that’s what it’s good at, W3TC would have nothing to do with that.

    When you look at your XCache x.x.x Administration page and select the list files do you see all of your WP php files listed? The beauty of x-cache is how much the file size is reduced in memory, for example the file at the top of my listing is 82k but the srcSize is only 9.5K and it’s being served directly from memory so it’s quite fast.

    Craig

    If those files are being combined and minified, then just edit the original files and clear the minify cache and possibly the page cache if there was a change in the minified file names.

    Craig

    Thread Starter almooj-craig

    (@almooj-craig)

    Pothi,

    Thanks for the nginx info on the possible if problems inside a location and the clever way you used a generated error to pass the request to Apache.

    location / {
      error_page 418 = @cachemiss;
      recursive_error_pages on;
    
      if ($request_method = POST) { return  418; }

    Craig

    I recently started using 0.9.3, first on a new 3.6 single user after getting it configured it works correctly with minimize.

    Then I did a manual upgrade on a 3.1.3 by first renaming the W3TC directory and then installing the new files from the 0.9.3. Minimize works fine.

    I also had an old 2.7mu where I tried to get 0.9.3 to work but had too many missing functions and fatal errors, so I upgraded 2.7mu to 3.6 and then manually installed 0.9.3 and minimize works fine on all of the different blogs, they also all run different templates.

    So to sum it up that’s 3 diverse uses of 0.9.3 that work correctly with minimize.

    Perhaps you have a configuration problem or there is some leftover file from when you upgraded?

    Craig

    Thread Starter almooj-craig

    (@almooj-craig)

    Pothi,

    Thanks for the reply. I took a look at the page cache and it uses _gzip so I thought I would implement that through nginx along with using the W3 method of using rewrite to serve out the .gzip version. The page_enhanced cache method is quite clever because it uses parameters that are available so that you can rewrite without even using php.

    Here is the Nginx conf just in case someone finds it useful. For now Nginx is serving out page and minimize files and in gzip if the browser supports it.

    server
    {
    	server_name www.mydomain.com;
    	listen 8080;
    	root /your/root/htdocs;
    	charset utf-8;
    
    	# BEGIN W3TC Page Cache core
    	set $w3tc_rewrite 1;
    	if ($request_method = POST) {
    		set $w3tc_rewrite 0;
    	}
    	if ($query_string != "") {
    		set $w3tc_rewrite 0;
    	}
    	#if ($http_cookie ~* "comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_swit")
    	if ($http_cookie ~* "comment_author|wp\-postpass|wordpress_logged_in|wptouch_swit")
    	{
    		set $w3tc_rewrite 0;
    	}
    	set $w3tc_enc "";
    	if ($http_accept_encoding ~ gzip)
    	{
    		set $w3tc_enc _gzip;
    	}
    	set $w3tc_ext "";
    	if (-f "$document_root/wp-content/cache/page_enhanced/$http_host/$request_uri/_index.html$w3tc_enc" )
    	{
    		set $w3tc_ext .html;
    	}
    
    	if (-f "$document_root/wp-content/cache/page_enhanced/$http_host/$request_uri/_index.xml$w3tc_enc")
    	{
    		set $w3tc_ext .xml;
    	}
    	if ($w3tc_ext = "") {
    	  set $w3tc_rewrite 0;
    	}
    	if ($w3tc_rewrite = 1)
    	{
    		rewrite .* "/wp-content/cache/page_enhanced/$http_host/$request_uri/_index$w3tc_ext$w3tc_enc";
    	}
    	location ~ /wp-content/cache/page_enhanced.*html$ {
    		expires modified 86400s;
    		add_header X-Cached "W3TC";
    		add_header Vary "Accept-Encoding, Cookie";
    		add_header Pragma "public";
    		add_header Cache-Control "max-age=86400, public";
    	}
    	location ~ /wp-content/cache/page_enhanced.*gzip$ {
    		gzip off;
    		types {}
    		default_type text/html;
    		expires modified 86400s;
    		add_header X-Cached 'W3TC';
    		add_header Vary 'Accept-Encoding, Cookie';
    		add_header Pragma 'public';
    		add_header Cache-Control 'max-age=86400, public';
    		add_header Content-Encoding gzip;
    	}
    	# END W3TC Page Cache core
    
    	# START W3TC Minify
    	#rewrite ^/wp-content/cache/minify.*/w3tc_rewrite_test$ /wp-content/plugins/w3-total-cache/pub/minify.php
    	location ~*
    	^.+.(js|css)$
    	{
    		try_files $uri @apachesite;
    	}
    
    	set $w3tc_enc "";
    	if ($http_accept_encoding ~ gzip) {
    		set $w3tc_enc .gzip;
    	}
    	#try_files $uri @apachesite;
    
    	if (-f $request_filename$w3tc_enc) {
    		rewrite (.*) $1$w3tc_enc break;
    	}
    	#rewrite ^/wp-content/cache/minify/(.+\.(css|js))$ /wp-content/plugins/w3-total-cache/pub/minify.ph$
    
    	location ~ /wp-content/cache/minify.*\.js$ {
    		types {}
    		default_type application/x-javascript;
    		expires 1y;
    		add_header X-Cached 'W3TC';
    		add_header Vary "Accept-Encoding";
    		add_header Pragma "public";
    		#add_header Cache-Control "max-age=604800, public";
    		add_header Cache-Control "public";
    	}
    	location ~ /wp-content/cache/minify.*\.css$ {
    		types {}
    		default_type text/css;
    		expires 1y;
    		add_header X-Cached 'W3TC';
    		add_header Vary "Accept-Encoding";
    		add_header Pragma "public";
    		#add_header Cache-Control "max-age=604800, public";
    		add_header Cache-Control "public";
    	}
    	location ~ /wp-content/cache/minify.*js\.gzip$ {
    		gzip off;
    		types {}
    		default_type application/x-javascript;
    		expires 1y;
    		#expires modified 604800s;
    		add_header X-Cached 'W3TC';
    		add_header Vary "Accept-Encoding";
    		add_header Pragma "public";
    		#add_header Cache-Control "max-age=604800, public";
    		add_header Cache-Control "public";
    		add_header Content-Encoding gzip;
    	}
    	location ~ /wp-content/cache/minify.*css\.gzip$ {
    		gzip off;
    		types {}
    		default_type text/css;
    		expires 1y;
    		add_header X-Cached 'W3TC';
    		add_header Vary "Accept-Encoding";
    		add_header Pragma "public";
    		#add_header Cache-Control "max-age=604800, public";
    		add_header Cache-Control "public";
    		add_header Content-Encoding gzip;
    	}
    	location @apachesite{
    		access_log off;
    		add_header Server Apache/2;
    		proxy_set_header X-Real-IP  $remote_addr;
    		proxy_set_header X-Forwarded-For  $remote_addr;
    		proxy_set_header Host $host;
    		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    		proxy_pass https://xxx.xxx.x.xx:80;
    	}
    	# END W3TC Minify
    
    	location ~*
    	^.+.(jpg|png|gif|pdf|flv|swf|ico|txt|cur|ico)$
    	{
    		try_files $uri @apachesite;
    		gzip on;
    		gzip_static on;
    		access_log off;
    		expires 1y;
    	}
    	location / {
    		access_log off;
    		add_header Server Apache/2;
    		proxy_set_header X-Real-IP  $remote_addr;
    		proxy_set_header X-Forwarded-For  $remote_addr;
    		proxy_set_header Host $host;
    		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    		proxy_pass https://xxx.xxx.x.xx:80;
    	}
    }	
    
    	server {
    		server_name ywca-blog.smywca.org *.ywca-blog.smywca.org *.ywca-blog.smywca.com *.ywca-blog.thescollards.com;
    		listen 8080;
    		root /www/ywca/blog/htdocs;
    		location ~*
    		^.+.(jpg|png|gif|js|css|pdf|flv|swf|ico|txt|cur)$
    		{
    			gzip on;
    			gzip_static on;
    			access_log off;
    			expires 1y;
    		}
    		location / {
    			access_log off;
    			add_header Server Apache/2;
    			proxy_set_header X-Real-IP  $remote_addr;
    			proxy_set_header X-Forwarded-For  $remote_addr;
    			proxy_set_header Host $host;
    			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    			proxy_pass https://xxx.xxx.x.xx:80;
    		}
    	}

    Most likely in the future I will just let Apache serve out the page cached files so that I can track them in the Apache server logs.

    Craig

Viewing 6 replies - 16 through 21 (of 21 total)