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? :)

Comments

mikeytown2’s picture

Status: Active » Postponed (maintainer needs more info)

It's already in place, I need more details as to why it's not working in your case.

/**
 * 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;
  }
}
giorgio79’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thanks Mikey, you are right.

I noticed this a while ago, but I retested it and it works fine.

Cheers,
G

giorgio79’s picture

Status: Fixed » Active

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

mikeytown2’s picture

Whats the process/modules you use so I can replicate this.

giorgio79’s picture

Thanks Mikey, I have tons of modules, so I will try first on a blank drupal install with boost, hopefully I can replicate there.

mikeytown2’s picture

Title: update cache on new comment » clear cache on comment approval
mikeytown2’s picture

Status: Active » Postponed (maintainer needs more info)
mikeytown2’s picture

Any news on replicating this?

giorgio79’s picture

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

mikeytown2’s picture

ping...

giorgio79’s picture

Status: Postponed (maintainer needs more info) » Fixed

Sorry Mikey, will put this on fixed for now, when I have time to test it and find some issues, I will reopen.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.