-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
invalidate page cache after creating new comment #13
Comments
What caching plugin do you use? |
WP Super Cache. let me know if i can help debug. not high priority, of course! |
The problem is, that I can't find a core function to clear the cache... I will have a look at what differs between my implementation and the implementation of pingbacks or classic comments... Perhaps I find the method that triggers the "clear cache"... |
OK, it seems that the cache plugin is clearing the cache on the following actions: // Coment ID is received
add_action('trackback_post', 'wp_cache_get_postid_from_comment', 99);
add_action('pingback_post', 'wp_cache_get_postid_from_comment', 99);
add_action('comment_post', 'wp_cache_get_postid_from_comment', 99);
add_action('edit_comment', 'wp_cache_get_postid_from_comment', 99);
add_action('wp_set_comment_status', 'wp_cache_get_postid_from_comment', 99, 2); And the webmention plugin uses Can you try adding this to your themes function.php or to the init of the webmention plugin?
|
good idea, thanks! sadly, it didn't work, either in my theme's functions.php or in webmention.php's |
Hmmm... What about pingbacks in general? Are you having the same problems with classic pingbacks? Have tried it with or without the semantic linkbacks plugin? |
i'm not sure about classic pingbacks or without the semantic plugin, but i can definitely try later today. thanks again for investigating. |
Ooops, ignore the reference... linked the wrong bug :( |
I started looking at the WP Super Cache docs and found this in http://ocaoimh.ie/wp-super-cache-developers/ : "Delete the cache files for a single post by using the wp_cache_post_change( $post_id ) function. It will attempt to delete every half-on cache file for that post, as well as any supercache files. in that last sentence, if he means query parameters for any http method, not just GET, that could explain why clearing the cache didn't work, and it gives us some ideas to try. |
I poked at a lot of things on my local server, and then a few things on my prod server, and this went away. I have no idea why. thanks for your help anyway! (just so the link is here, I also asked about this in the WP Super Cache forums: http://wordpress.org/support/topic/cached-pages-not-cleared-when-another-plugin-creates-comments ) |
when someone posts a new comment normally, wordpress invalidates the cached copy of the page, if it exists, so that the next request will fully re-render the page and include the new comment. it looks like wordpress-webmention doesn't do this when it stores a new comment, but it probably should.
i didn't notice this at first because i'm usually logged into my wordpress, and it skips the cache for logged in users by default and always fully renders pages.
The text was updated successfully, but these errors were encountered: