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

mikeytown2 - July 6, 2009 - 04:12
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

giorgio79 - July 8, 2009 - 09:05
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

giorgio79 - July 12, 2009 - 19:15
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

mikeytown2 - July 12, 2009 - 19:33

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

#5

giorgio79 - July 13, 2009 - 09:07

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

mikeytown2 - July 14, 2009 - 08:58
Title:update cache on new comment» clear cache on comment approval

#7

mikeytown2 - July 15, 2009 - 09:09
Status:active» postponed (maintainer needs more info)

#8

mikeytown2 - July 25, 2009 - 07:37

Any news on replicating this?

#9

giorgio79 - July 25, 2009 - 08:51

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

mikeytown2 - August 8, 2009 - 08:11

ping...

#11

giorgio79 - August 8, 2009 - 10:01
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

System Message - August 22, 2009 - 10:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.