Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Been having a bit of a problem with my site regarding our caching method and my php code not refreshing or flushing.

To start, my site is on a dedicated Nginx webserver. I used W3 Total Cache for the initial caching setup. Everything was set up to cache through Memcached.
(I should note, my website is somewhat of a 'guest' on this server, which is bit of a semi-community donation semi-sponsored server that runs some other things. The admins are skilled but also volunteers. I have their full support for fixing things, but they don't have time to troubleshoot my very odd issue (especially because I asked for caching to get turned on for the site myself). If we had some hints on what to go on it would make things easier for us than taking shots in the dark ;) So any suggestions are welcomed.)

At some point we noticed that changes to php pages and Wordpress & Plugin updates were not working at all, while the code on the server reflected updates, the pages still processed through the older php code.

This presented a couple unique issues. W3 Total Cache stores it settings in php files. Other php files, when deleted, stop working, but when they are restored to the server, memcached still insists on using its ultra-old memcached copy. The W3 Total Cache settings, whether i removed or altered the settings php files, would NOT stop running everything through cached memcached data.

The server admin attempt rebooting memcached and then flushing it. Neither of those seemed to have any effect. All the other basic settings seem to be set-up correctly.

We can, of course, still add new plugins, all the data that comes from the database works just fine.

At least one other site on the server that is not wordpress also uses memcached with no issues.

Any help is appreciated, should be able to provide further information if it is needed.

share|improve this question
    
I should note that I have tried to disable W3 Total Cache in multiple ways. I've turned it off, deleted it entirely, reinstalled it. All of those steps were followed by a good 15 minute wait. -- Actually, I once deleted the entire site, put up a plain HTML splash screen, waited a few hours, and re-uploaded everything (having updated WordPress and plugins in the process). No updates 'took', memcached still used the old version of the code. Unlike most plugins that store their settings in the database, Total Cache stores them in a .php file :( –  Duiwel Jun 23 '12 at 17:23
add comment

2 Answers

up vote 3 down vote accepted
+25

So any suggestions are welcomed.

Suggestion #1 - Whenever Memcache is available in the server, I prefer Memcached Object Cache and Batcache, unless I have a specific reason to use W3 Total Cache. Whatever, W3 Total Cache offers, can be achieved without it too. For example, for minify, we have Better WP Minify, For Varnish, there is WordPress Varnish. For Cloudflare integration, there is a plugin too.

my site is on a dedicated Nginx webserver. I used W3 Total Cache for the initial caching setup. Everything was set up to cache through Memcached.

Suggestion #2. Switch to "Page Cache" in Disk: Enhanced mode. Setting up W3 Total Cache with Nginx may look tricky, but easy once we understand how it's done. Let me share how to do this. Usually, W3 Total Cache creates a file named nginx.conf in the /path/to/wordpress/installation. So, your Nginx's vhost would be like...

server {
  server_name domain.com;
  root /path/to/wordpress/installation;
  index index.php;

  # W3 Total Cache configuration should be included here
  # if not, W3TC may not work and may only complain
  include $document_root/nginx.conf;

  # [...] all other stuff such as ...
  # location ~ \.php$ { } block
  # location \ { } block
}

Please note, whenever you change something in the W3 Total Cache configuration (via WordPress backend), the Nginx server must be reloaded like nginx -t && service nginx reload (I know it's crazy, but that's how we could make the changes to take effect). So, it is recommended to set it up and forget it. W3TC's Page Cache just works with Nginx.

I'm sorry, I couldn't answer your original concern (PHP Code stuck in Cache [Memcached])

share|improve this answer
add comment

First of all, this isn't a WordPress issue - it's a Memcache issue - and if not for the open bounty, I'd close it as off-topic.

Seconds, if your problem is with Memcache serving old content, then it sounds like you need to flush Memcache.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.