W3 Total Cache broke my WordPress site

W3 Total Cache 0.9.5.2 broke my website rendering nothing but gibberish. I know that the Minify JS setting can cause issues since W3 Total Cache attempts to minify javascript files that are already minified. This in turn causes CSS files not to render properly. I’ve had this issue in the past and fixed it by manually specifying which javascript files to minify. More info on fixing that can be found here.
This time around it wasn’t the minify JS settings that were causing my problem. After scratching my head for about an hour I decided to Restore Default Settings which can be found at the bottom of the General Settings section. This fixed the issue temporarily. Once I started adding my settings back, gibberish again! I restored again and changed my settings one by one until I found the culprit, Page Cache. Yes, turning on Page Cache under General Settings was causing the gibberish to be rendered. I’m not sure if that was specific to the Catch Box theme I was using but it was a real pain in the ass and caused me an hour of downtime. Anyone have any caching alternatives they’d liked to recommend?

Update: I re-enabled Page Cache and turned off Enable HTTP (gzip) compression which can be found under Browser Cache. This also fixed the issue while decreasing page load times. This issue seems to only be affecting servers using PHP 5.3xx. Patiently waiting for an update from W3TC.

Update #2: Here’s the fix from the W3TC community.
1. Open PgCache_ContentGrabber.php (found in the w3-total-cache directory)
2. Jump down to line 1244 which should show:

if ( isset( $value0['n'] ) ) {

3. Replace that line with:

if ( is_array($value0) && isset( $value0['n'] ) ) {

This fix will be included in the next update.

Leave a Reply

Your email address will not be published. Required fields are marked *

Please Do the Math      
 

*