Download & Extend

clear cache on comment approval

Project:Boost
Version:6.x-1.x-dev
Component:Caching logic
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

#1

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.

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

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

#3

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

#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

Title:update cache on new comment» clear cache on comment approval

#7

Status:active» postponed (maintainer needs more info)

#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

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.

#12

Status:fixed» closed (fixed)

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