Would it be possible to have individual pages' cache get flushed each time a new comment is posted on that page? Right now, each time a comment is posted I have to manually flush the cache. Sorry if this is a duplicate... I searched but did not find this particular info.

CommentFileSizeAuthor
#2 boost-609900.patch1.01 KBmikeytown2

Comments

mikeytown2’s picture

That should be built in with the comment hook. Can you give me more info?

/**
 * 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'])) {
        $node = node_load($comment['nid']);
        boost_expire_node($node);
      }
      break;
    case 'publish':
    case 'unpublish':
    case 'delete':
      if (!empty($comment->nid)) {
        $node = node_load($comment->nid);
        boost_expire_node($node);
      }
      break;
  }
}
mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new1.01 KB

I do know that node_load in hooks can sometimes cause issues, try this patch just for kicks...

gregarios’s picture

Status: Needs review » Fixed

My mistake. It does seem to be working without the patch... it was just somewhat difficult to test. I forgot to keep the cron run times in my mind when I was creating the comment, etc...

Status: Fixed » Closed (fixed)

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