Support » Plugin: W3 Total Cache » [Plugin: W3 Total Cache] Turning Page Cache On breaks ability to comment

  • Hi.. I have been spending the weekend getting your plugin up to speed and it’s great so far! Only problem is that when I turn on Page Caching, people try to comment and they get stuck on a blank white screen with the url /wp-comments-post.php

    That file is there and works perfectly when page caching is not on. I have pretty much everything else working, CDN, Minify for css and js, but page caching gives me a blank page when someone tries to submit a comment. The comment goes through, but the person gets stuck on /wp-comments-post.php and they are not taken back to the page where they made a comment.



Viewing 12 replies - 1 through 12 (of 12 total)
  • To clarify my problem, I have turned off ALL plugins except for w3-total-cache and I still have the problem.

    I am running PHP v 5.2.13 with WordPress 3.0 with mysql 5.0.91 and WordPress is installed in the root directory of the site (ie: it’s a standard install.) Even with EVERY other plugin disabled, I still cannot make comments when Page Cache is on (with the option “no cache” for logged in users – you have to be logged in to make a comment.)

    In addition, when I turn off everything in w3-total-cache, and ONLY turn on Page cache, with pages not caching for logged in users, people cannot make comments.

    After hitting submit, the site goes to a page /wp-comments-post.php and then just hangs there with a white screen. It might be some kind of redirect issue, but w3-total-cache is writing to the htaccess file with no problem.

    The comment is made, it’s just that the person is not redirected back to the page where he/she made the comment.

    Comments are very important to my site as I have over 175,000 of them and I get about 20,000 page-views a day on my site, so caching is very important to me as well.

    Thanks fredericktownes if you can help me.


    I have more info on the page caching breaking comments.

    My website is set up where people have to be logged in to make comments.

    When I turn on page caching, even though it’s off for logged in users, which they have to be in order to make comments, your plugin stops calling wp_redirect($location); at the end of wp-comments-post.php

    This breaks for some reason:
    $location = empty($_POST['redirect_to']) ? get_comment_link($comment_id) : $_POST['redirect_to'] . '#comment-' . $comment_id;

    And it ends up hanging on the wp-comments-post.php page without redirecting back to the comment, even though the comment IS posted.

    I have someone debugging it right now to see if we can figure out a solution.

    OK.. I hacked my wordpress installation to fix the error, which may end up breaking wordpress for me down the road but it seems to have fixed the broken comments issue. I can now make comments when Page Caching is activated.

    I commented out a couple do_actions in includes/comment.php

    on line 1178 I commented it out:
    //do_action('wp_insert_comment', $id, $comment);

    on line 1273 also commented out”

    //do_action('comment_post', $comment_ID, $commentdata['comment_approved']);

    on lines 1503 and 1504 I commented out:

    //do_action('wp_update_comment_count', $post_id, $new, $old);
    	//do_action('edit_post', $post_id, $post);

    Now I am able to make comments with Page Caching on.

    Can you look into why this is and why I need to comment those out when I turn on Page Caching?


    Hi HotForWords,

    I’m positive this is caused by your comments.php page, as commenting works perfectly fine on my site with W3 Total cache, and we receive 250,000 page views a day. So the problem is not with W3 Total cache, but rather with your own comments php file.

    While on the topic of speed optimization, I strongly recommend you download Firebug + Google Pagespeed (addons for Firefox) to see what the current bottlenecks are on your site. I took a quick look and there are a lot of little things you can do to speed things up significantly. Set dimensions for images and enable browser caching.

    As is, your site has some 155+ HTTP requests which NEED to be cut down =/. 155 HTTP Requests is ridiculous. You should ask your theme designer to use CSS sprites to cut down on the http requests.

    Hi remotay,I
    That makes total sense! I’ll replace the comments.php page with a standard one! I remember tweaking it to put the comment box at the top of the page, and that must have broken something.

    Thanks so much for pointing that out!

    Now, on to reading about sprites! 🙂


    I replaced the comments.php with the one from TwentyTen and it didn’t fix it.. BUT when I activate TwentyTen as my theme, I am able to post comments while Page Caching is on.

    So you are correct, there is a problem with my Theme. It is a purchased theme, and in the interest of making it easy for people to customize the theme, they tend to put in all kinds of things that are most likely not necessary.. so I will go through and start pruning things until I isolate the problem.

    Thanks again.


    Plugin Author Frederick Townes


    A productive thread. @hotforwords, please submit a bug submission form from the support tab of the plugin if you want further help.

    I am experiencing this exact problem as well. I have had to uninstall W3TC until it can be resolved. Is there an open ticket for this issue?

    Plugin Author Frederick Townes


    @rsknowles are all of your WordPress files the default unchanged core files?

    To my knowledge, yes… I’ll run a file compare today to double check.

    I ran a file diff on all files in wp-include and it resulted in no differences.

    Plugin Author Frederick Townes


    Since I can’t ask you to publicly post what I need to investigate, can you submit a bug submission form from the support tab of the plugin?

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: W3 Total Cache] Turning Page Cache On breaks ability to comment’ is closed to new replies.