Exclude comment page from cache
-
Hello @wildthing333
Thank you for reaching out and I am happy to help!
Can you please share the website URL if possible and check the Performance>Page Cache section of the plugin, scroll down to purge policy and let me know if the option Post comments feed is enabled?
Thanks!The site is https://behindtheblack.com/
I had to disable page caching because it is problematic as described in the original post. The site works perfectly when page cache is disabled.
When I enable it, it caches the comment count (on the homepage for each post) and will not refresh the comments on the actual post page as per my detail above.
See the circled block. This area on the homepage for each post will not update – and stay cached on the homepage, even if 100 comments are posted. it just stays at the cached count.
If i turn off page count, the totals immediately show the correct number.



-
This reply was modified 1 year ago by
wildthing333.
-
This reply was modified 1 year ago by
wildthing333.
-
This reply was modified 1 year ago by
wildthing333.
Hello @wildthing333
Thank you for the clarification.
Just to confirm, if the comment is posted it awaits for the moderation and wont be published automatically untill approved?
Can you please let me know if you are using native WP for those comments or some plugin?
If you purge the cache once the comment is approved, does the problem still persist?
Thanks!Users on the site are all anonymous. When they submit a comment, they provide their name and email. After submission the user immediately sees their comment in the list of comments, but it is noted that the comment awaits moderation.
If at that time another user goes to the same page, they will not see the comment pending moderation.
When the admin approves the comment, and another anonymous visitor goes to the site, they still see the old list and count of comments, not the new comment and new comment title.
I know for sure if I disable Page Cache, it immediately globally resolves this issue, but I will have to turn on Page Cache late at night and test this to see if I do the above, and hit empty cache, if that also solves the problem. i will reply back once I test that.
-
This reply was modified 1 year ago by
The topic ‘Exclude comment page from cache’ is closed to new replies.
(@wildthing333)
1 year ago
I am having an issue with W3TC where the Page Cache is caching the comments to posts on a site I assist with, and shows the anonymous guests the wrong actual number of comments.
Example/Narrative.
Site has 6 comments on a post.
Go to the site and the anonymous user sees a cached version that shows 3 comments.
User submits a comment.
Comment is in awaiting moderation
User can now see all 7 comments, 6 good ones and 1 in moderation.
Open a different browser. Go to same post. Page still shows 3 comments.
If I disable page cache, all users can now see 6 comments.
So in effect, I need to somehow purge the page cache for any page affected by adding a comment. In this case, if the main post shows on the homepage, and it shows on it’s own page, I need to have those pages dumped and re-loaded into the cache so that all users will see the correct # of comments.
As it is now, due to the incorrect comment counts, it is very confusing to the anonymous users.