clear cache on comment approval
giorgio79 - July 4, 2009 - 07:07
| Project: | Boost |
| Version: | 6.x-1.x-dev |
| Component: | Caching logic |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hello,
Was just approving some comments on my site and noticed the cache does not update after the comment gets published.
Any plans for comment integration? :)

#1
It's already in place, I need more details as to why it's not working in your case.
<?php
/**
* Implementation of hook_comment(). Acts on comment modification.
*/
function boost_comment($comment, $op) {
if (!BOOST_ENABLED) return;
switch ($op) {
case 'insert':
case 'update':
// Expire the relevant node page from the static page cache to prevent serving stale content:
if (!empty($comment['nid'])) {
boost_cache_expire_derivative('node/' . $comment['nid'], TRUE);
}
break;
case 'publish':
case 'unpublish':
case 'delete':
if (!empty($comment->nid)) {
boost_cache_expire_derivative('node/' . $comment->nid, TRUE);
}
break;
}
}
?>
#2
Thanks Mikey, you are right.
I noticed this a while ago, but I retested it and it works fine.
Cheers,
G
#3
Hey Mikey,
Lately I have been following this closely, and it seems only occasionally, but the cache does not get expired, when I approve a comment.
It may be a third party module preventing it? Is there anything I can do to troubleshoot this? The problem is that I was paying close attention, and the page did not clear after I approved a comment, yet there are no warnings or entries in watchdog. Other times it clears it fine.
Not sure what this could be.
Cheers,
G
#4
Whats the process/modules you use so I can replicate this.
#5
Thanks Mikey, I have tons of modules, so I will try first on a blank drupal install with boost, hopefully I can replicate there.
#6
#7
#8
Any news on replicating this?
#9
sorry my comp at home crashed two weeks ago so i am still rebuilding the stuff.
Will test this in the next week or two
#10
ping...
#11
Sorry Mikey, will put this on fixed for now, when I have time to test it and find some issues, I will reopen.
#12
Automatically closed -- issue fixed for 2 weeks with no activity.