<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Debugging the w3tc Page Cache	</title>
	<atom:link href="https://www.shibashake.com/wp/debugging-the-w3tc-page-cache/feed" rel="self" type="application/rss+xml" />
	<link>https://shibashake.com/wp/debugging-the-w3tc-page-cache</link>
	<description>Adventures in WordPress</description>
	<lastBuildDate>Wed, 31 Jul 2013 02:54:09 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9</generator>
	<item>
		<title>
		By: Daniel		</title>
		<link>https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77742</link>

		<dc:creator><![CDATA[Daniel]]></dc:creator>
		<pubDate>Wed, 31 Jul 2013 02:54:09 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11852#comment-77742</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77611&quot;&gt;ShibaShake&lt;/a&gt;.

Ok, that&#039;s weird - TotalCache.php only has 823 lines in mine. And I&#039;m running the latest version.

I&#039;m going to try uninstalling w3tc and then reinstalling it and see what happens. I have a backup of my settings.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77611">ShibaShake</a>.</p>
<p>Ok, that&#8217;s weird &#8211; TotalCache.php only has 823 lines in mine. And I&#8217;m running the latest version.</p>
<p>I&#8217;m going to try uninstalling w3tc and then reinstalling it and see what happens. I have a backup of my settings.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: ShibaShake		</title>
		<link>https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77611</link>

		<dc:creator><![CDATA[ShibaShake]]></dc:creator>
		<pubDate>Sat, 27 Jul 2013 04:52:18 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11852#comment-77611</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77601&quot;&gt;Daniel&lt;/a&gt;.

To call the function, you need to do -
$this-&gt;_is_cacheable_content_type()
because the function is part of the object class.

&lt;blockquote&gt;Well, I added the debug code as line 328, and nothing got output to the html&lt;/blockquote&gt;

That is very strange. I would try just adding a simple debug line and see if it appears.
$buffer .= &quot;&#060;!-- Start ob_callback --&gt;&quot;; return $buffer;

If not, then there may be something deeper going on than just the page cache. The ob_callback functions all get called in the TotalCache.php file, in line 1351.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77601">Daniel</a>.</p>
<p>To call the function, you need to do &#8211;<br />
$this->_is_cacheable_content_type()<br />
because the function is part of the object class.</p>
<blockquote><p>Well, I added the debug code as line 328, and nothing got output to the html</p></blockquote>
<p>That is very strange. I would try just adding a simple debug line and see if it appears.<br />
$buffer .= &#8220;&lt;!&#8211; Start ob_callback &#8211;>&#8221;; return $buffer;</p>
<p>If not, then there may be something deeper going on than just the page cache. The ob_callback functions all get called in the TotalCache.php file, in line 1351.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Daniel		</title>
		<link>https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77601</link>

		<dc:creator><![CDATA[Daniel]]></dc:creator>
		<pubDate>Sat, 27 Jul 2013 00:12:10 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11852#comment-77601</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77571&quot;&gt;ShibaShake&lt;/a&gt;.

Well, I added the debug code as line 328, and nothing got output to the html. But ob_callback has to have been called, right?

ob_callback is called on line 214, but if I try adding
echo &quot;_is_cacheable_content_type() . &quot; -&#062;&quot;;
above it, php pukes. If I use
echo &quot;_debug . &quot; -&#062;&quot;;
there instead, it outputs as expected.  Which makes sense, since _is_cacheable_content_type() is a private function, now that I look closer. And adding 
$buffer .= &quot;&#060;!-- DEBUG: &quot; . $this-&#062;_is_cacheable_content_type() . &quot; --&gt;&quot;;
to the end of the function (before the $cache_headers variable is set) adds nothing to the html either.

Still hammering at it...

Daniel]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77571">ShibaShake</a>.</p>
<p>Well, I added the debug code as line 328, and nothing got output to the html. But ob_callback has to have been called, right?</p>
<p>ob_callback is called on line 214, but if I try adding<br />
echo &#8220;_is_cacheable_content_type() . &#8221; -&gt;&#8221;;<br />
above it, php pukes. If I use<br />
echo &#8220;_debug . &#8221; -&gt;&#8221;;<br />
there instead, it outputs as expected.  Which makes sense, since _is_cacheable_content_type() is a private function, now that I look closer. And adding<br />
$buffer .= &#8220;&lt;!&#8211; DEBUG: &#8221; . $this-&gt;_is_cacheable_content_type() . &#8221; &#8211;>&#8221;;<br />
to the end of the function (before the $cache_headers variable is set) adds nothing to the html either.</p>
<p>Still hammering at it&#8230;</p>
<p>Daniel</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: ShibaShake		</title>
		<link>https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77571</link>

		<dc:creator><![CDATA[ShibaShake]]></dc:creator>
		<pubDate>Fri, 26 Jul 2013 03:50:16 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11852#comment-77571</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77568&quot;&gt;Daniel&lt;/a&gt;.

Try adding a debug message at the beginning of the ob_callback function, something like -
$buffer .= &quot;&#060;!-- Start ob_callback &quot; . $this-&gt;_is_cacheable_content_type() . &quot; --&gt;&quot;;


It could be that we are failing on the condition in line 328 and so we never get to line 332.

In general, if nothing is showing, then likely the fail point is somewhere above it.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77568">Daniel</a>.</p>
<p>Try adding a debug message at the beginning of the ob_callback function, something like &#8211;<br />
$buffer .= &#8220;&lt;!&#8211; Start ob_callback &#8221; . $this->_is_cacheable_content_type() . &#8221; &#8211;>&#8221;;</p>
<p>It could be that we are failing on the condition in line 328 and so we never get to line 332.</p>
<p>In general, if nothing is showing, then likely the fail point is somewhere above it.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Daniel		</title>
		<link>https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77568</link>

		<dc:creator><![CDATA[Daniel]]></dc:creator>
		<pubDate>Fri, 26 Jul 2013 03:14:02 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11852#comment-77568</guid>

					<description><![CDATA[Hmm. So I added the line 
$buffer .= &quot;&#060;!-- DEBUG:  $can_cache  --&gt;&quot;;
to line 332 (right after $can_cache is defined), but nothing appears in the html. Did I misunderstand how to get output from within ob_callback?

Do you know where I can stick a debug line to get the output of $this-&#062;cache_reject_reason from _can_cache2()? 

I did submit a query to the author but have not heard back as of yet. I also posted on the WP support forum. I&#039;m trying every avenue I can think of, as I try to sort through the code, etc. 

If you&#039;d be willing to take a peek, I absolve you of any risk. I promise no tears, fists, angry words, or recrimination (I know you&#039;d make a copy of any file before you edited it, and I can live with a couple of seconds of downtime while troubleshooting!). Email me and I&#039;d be glad to set you up with an ssh account! I do understand if you don&#039;t want to take on the risk though.

Thanks again,

Daniel]]></description>
			<content:encoded><![CDATA[<p>Hmm. So I added the line<br />
$buffer .= &#8220;&lt;!&#8211; DEBUG:  $can_cache  &#8211;>&#8221;;<br />
to line 332 (right after $can_cache is defined), but nothing appears in the html. Did I misunderstand how to get output from within ob_callback?</p>
<p>Do you know where I can stick a debug line to get the output of $this-&gt;cache_reject_reason from _can_cache2()? </p>
<p>I did submit a query to the author but have not heard back as of yet. I also posted on the WP support forum. I&#8217;m trying every avenue I can think of, as I try to sort through the code, etc. </p>
<p>If you&#8217;d be willing to take a peek, I absolve you of any risk. I promise no tears, fists, angry words, or recrimination (I know you&#8217;d make a copy of any file before you edited it, and I can live with a couple of seconds of downtime while troubleshooting!). Email me and I&#8217;d be glad to set you up with an ssh account! I do understand if you don&#8217;t want to take on the risk though.</p>
<p>Thanks again,</p>
<p>Daniel</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: ShibaShake		</title>
		<link>https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77566</link>

		<dc:creator><![CDATA[ShibaShake]]></dc:creator>
		<pubDate>Fri, 26 Jul 2013 01:11:21 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11852#comment-77566</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77565&quot;&gt;Daniel&lt;/a&gt;.

1 means that condition passed, so I would move on to the next condition, i.e. in the ob_callback function. 

For example, the issue with my caching resided in the $this-&gt;_is_cacheable_content_type() function (which was fixed in a later plugin update). The issue can also be from $this-&gt;_can_cache2. I would try printing out those two values (1 = ok, 0 = fail, so the problem is probably somewhere in there).

I could try and hunt down the bug for you, but as a rule, I don&#039;t want to mess around with a live site. There is just too much risk for something going wrong, and then there will be tears, fists, and angry words. ;)

Have you tried contacting the w3tc author? I think he does consulting work.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77565">Daniel</a>.</p>
<p>1 means that condition passed, so I would move on to the next condition, i.e. in the ob_callback function. </p>
<p>For example, the issue with my caching resided in the $this->_is_cacheable_content_type() function (which was fixed in a later plugin update). The issue can also be from $this->_can_cache2. I would try printing out those two values (1 = ok, 0 = fail, so the problem is probably somewhere in there).</p>
<p>I could try and hunt down the bug for you, but as a rule, I don&#8217;t want to mess around with a live site. There is just too much risk for something going wrong, and then there will be tears, fists, and angry words. 😉</p>
<p>Have you tried contacting the w3tc author? I think he does consulting work.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Daniel		</title>
		<link>https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77565</link>

		<dc:creator><![CDATA[Daniel]]></dc:creator>
		<pubDate>Fri, 26 Jul 2013 00:34:56 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11852#comment-77565</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77506&quot;&gt;ShibaShake&lt;/a&gt;.

Yeah, I learned my lesson a long time ago about editing files without having a copy of the original at hand! Thanks. 

I got a value of 1 for $this-&#062;_caching. I looked through the code as best I could, but I&#039;m still no closer to figuring out why it&#039;s only caching feeds. I even have it set to preload the cache.

Thanks for trying to help. If you feel inclined to help me dig deeper, I&#039;d be very grateful, but I appreciate the time you&#039;ve given me.

Daniel]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77506">ShibaShake</a>.</p>
<p>Yeah, I learned my lesson a long time ago about editing files without having a copy of the original at hand! Thanks. </p>
<p>I got a value of 1 for $this-&gt;_caching. I looked through the code as best I could, but I&#8217;m still no closer to figuring out why it&#8217;s only caching feeds. I even have it set to preload the cache.</p>
<p>Thanks for trying to help. If you feel inclined to help me dig deeper, I&#8217;d be very grateful, but I appreciate the time you&#8217;ve given me.</p>
<p>Daniel</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: ShibaShake		</title>
		<link>https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77506</link>

		<dc:creator><![CDATA[ShibaShake]]></dc:creator>
		<pubDate>Wed, 24 Jul 2013 23:38:28 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11852#comment-77506</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77505&quot;&gt;Daniel&lt;/a&gt;.

I usually add my debug messages before conditional statements, i.e., before there is some sort of test. 

&lt;strong&gt;Note&lt;/strong&gt; - I make sure to keep an old copy of any of the files I modify so I can easily restore if necessary. If working on a live site, I only make very small changes so that I don&#039;t get myself into a bad or irrecoverable state.

For example, page caching starts with the process() function. On line 195 there is a conditional checking for $this-&gt;_caching. Therefore, I place an echo before this and print out the $this-&gt;_caching value.

If it is false, then I have my starting position. I look at where $this-&gt;_caching gets set (i.e. by the $this-&gt;_can_cache() function) and work from there. I do the same thing for the ob_callback function. 

Good luck bug hunting. Let us know if you find anything.
]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77505">Daniel</a>.</p>
<p>I usually add my debug messages before conditional statements, i.e., before there is some sort of test. </p>
<p><strong>Note</strong> &#8211; I make sure to keep an old copy of any of the files I modify so I can easily restore if necessary. If working on a live site, I only make very small changes so that I don&#8217;t get myself into a bad or irrecoverable state.</p>
<p>For example, page caching starts with the process() function. On line 195 there is a conditional checking for $this->_caching. Therefore, I place an echo before this and print out the $this->_caching value.</p>
<p>If it is false, then I have my starting position. I look at where $this->_caching gets set (i.e. by the $this->_can_cache() function) and work from there. I do the same thing for the ob_callback function. </p>
<p>Good luck bug hunting. Let us know if you find anything.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Daniel		</title>
		<link>https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77505</link>

		<dc:creator><![CDATA[Daniel]]></dc:creator>
		<pubDate>Wed, 24 Jul 2013 22:44:59 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11852#comment-77505</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77502&quot;&gt;ShibaShake&lt;/a&gt;.

I am running the most recent version. I don&#039;t have a test site up at the moment.

Are there any specific places in w3-total-cache/lib/W3/PgCache.php that you would suggest I add the debugging? And where in ob_callback did you append to $buffer?

Thank you. We&#039;ve put many years of work into the site. I&#039;m anxious to have it running properly again. I even reset the w3tc config to the default settings, but no improvement. Any help you can provide is so very welcome.

Daniel]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77502">ShibaShake</a>.</p>
<p>I am running the most recent version. I don&#8217;t have a test site up at the moment.</p>
<p>Are there any specific places in w3-total-cache/lib/W3/PgCache.php that you would suggest I add the debugging? And where in ob_callback did you append to $buffer?</p>
<p>Thank you. We&#8217;ve put many years of work into the site. I&#8217;m anxious to have it running properly again. I even reset the w3tc config to the default settings, but no improvement. Any help you can provide is so very welcome.</p>
<p>Daniel</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: ShibaShake		</title>
		<link>https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77502</link>

		<dc:creator><![CDATA[ShibaShake]]></dc:creator>
		<pubDate>Wed, 24 Jul 2013 22:00:14 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11852#comment-77502</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77498&quot;&gt;Daniel&lt;/a&gt;.

&lt;blockquote&gt;If I view source in the browser, there is no indication at all that w3tc exists&lt;/blockquote&gt;

Yeah, currently, the debug messages from w3tc only get tagged on at the end, so if some condition fails in the interim, then they won&#039;t show up. 

This is why I do the echo messages within the page caching process, it is a simple (albeit primitive) way to pinpoint which exact condition the cache is failing on. Another possibility is to set up a PHP debugger.
http://stackoverflow.com/questions/888/how-do-you-debug-php-scripts

Are you using the most recent w3tc version? Do you have a test site that is also showing this behavior?

Interesting site btw. ]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://shibashake.com/wp/debugging-the-w3tc-page-cache/comment-page-1#comment-77498">Daniel</a>.</p>
<blockquote><p>If I view source in the browser, there is no indication at all that w3tc exists</p></blockquote>
<p>Yeah, currently, the debug messages from w3tc only get tagged on at the end, so if some condition fails in the interim, then they won&#8217;t show up. </p>
<p>This is why I do the echo messages within the page caching process, it is a simple (albeit primitive) way to pinpoint which exact condition the cache is failing on. Another possibility is to set up a PHP debugger.<br />
<a href="http://stackoverflow.com/questions/888/how-do-you-debug-php-scripts" rel="nofollow ugc">http://stackoverflow.com/questions/888/how-do-you-debug-php-scripts</a></p>
<p>Are you using the most recent w3tc version? Do you have a test site that is also showing this behavior?</p>
<p>Interesting site btw. </p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Page Caching using disk: enhanced 
Content Delivery Network via Amazon Web Services: CloudFront: cdn.shibashake.com
Minified using disk
Database Caching 8/29 queries in 0.008 seconds using disk

Served from: www.shibashake.com @ 2026-07-22 12:53:06 by W3 Total Cache
-->