I've been working with 2 different versions of W3TC (0.9.3 and 0.9.2.4) but am experiencing the same caching issue and I can't figure out what's causing it.
Basically I have W3TC configured to use memcached for object cache on the live servers, and to use disk cached for my dev machine. I have some code that I use to cache various portions of a page:
global $post;
$expire = 60*60*1;
$cacheKey= $post->ID."#".$page;
$cacheGroup = "single";
$output = wp_cache_get( $cacheKey, $cacheGroup );
if ( $output != "" ) {
// use cached value
echo "<!-- use cache: ".$cacheGroup."#".$cacheKey." -->";
echo $output;
} else {
echo "<!-- build cache: ".$cacheGroup."#".$cacheKey." -->";
ob_start();
?>
HTML HERE...
<?php
$output =ob_get_flush();
// now cache output
echo "<!-- save cache: ".$cacheGroup."#".$cacheKey." ".$expire." -->";
wp_cache_set( $cacheKey, $output, $cacheGroup, $expire );
echo "<!-- done -->";
}
?>
This will basically save the display of the body of a page into object cache. 1st request to a page you see the 'build' comment, then all following requests until the cache expires you see the 'use cache' comment.
My Problem: I've noticed that every time I go into the admin in edit a post and save it (generally in a published state) when I re-request my page I notice it always needed to have the cache rebuilt again. Every page that had been previously cached now needed their cache rebuilt when requested.
It seems is something is getting trigger on post save that is flushing the object cache. From looking at the plugin settings I don't see anything.
I've tried shutting off all other plugins, switching themes, but the problem still happens. I would think if this were a problem with W3TC then everyone would be having it.
Has anyone else had this type of problem?