An anonymous users do not see new messages.
I think you need to add option to clear cache page (in settings).

Comments

mstef’s picture

I'm guessing you turned on the cache in the performance settings? What did you expect to happen?

si.mon’s picture

I encountered the same problem.
I used the shoutbox api in order to clear the cache each time a new shout is posted (as it would happen when a new comment/node/etc. is published). Clearly not the best solution but it works.
Here's the code:

/**
 * Implementation of hook_shoutbox
 * See shoutbox.api.php
 */
function modulename_shoutbox($op, &$shout, &$a1 = NULL, $form_state = NULL){
  switch ($op) {
    case 'insert':
    case 'edit':
    case 'delete':
      cache_clear_all();
      break;
  }
}

If someone has a better solution I would love to hear it !

mstef’s picture

Well, this is the block or page? Both? I believe cache options for both can be set explicitly to avoid caching. Sound right?

yareckon’s picture

The shoutbox page should definitely be cacheable. When a new shout is set to published though, the cache should be regenerated. Looks like an interesting approach to do this in your snipplet there, but I think that killing the entire drupal cache is a bit overboard? Maybe we could do something like this http://drupal.org/node/42055#comment-3431966 ?

ggevalt’s picture

Hi,

Where should this code be placed?

And since so much time has passed, have you found this to be useful to allow Shoutbox to refresh itself when there is a new submission in the block?

Also, will this resolve the issue that the CSS seems to be blown away once the block is cached?

thanks

geoff

si.mon’s picture

Hello ggevalt,

This code has to be placed in a custom module.
If your module was named "custom_shoutbox" then the code would look like this:

<?php
/**
* Implementation of hook_shoutbox
* See shoutbox.api.php
*/
function custom_shoutbox_shoutbox($op, &$shout, &$a1 = NULL, $form_state = NULL){
  switch ($op) {
    case 'insert':
    case 'edit':
    case 'delete':
      cache_clear_all();
      break;
  }
}
?>

But just a reminder: this is not a viable solution as this is going to clear cache on each insert, edit and delete !
br,
Simon

ggevalt’s picture

Simon,
Thanks for responding. Didn't see this until now. Will give it a go on a dev site and see what we see. I'll get back here with results, but it is going to be a while.
g