cache_clear_all() contains the following code:

  if (!isset($cid) && !isset($table)) {
    cache_clear_all(NULL, 'cache_page');
    cache_clear_all(NULL, 'cache_block');
    return;
  }

Am I right in thinking that the block cache should be cleared before the page cache? So that if an anonymous user happens to hit a page in between the two calls, they don't end up putting the old blocks back into the page cache.

CommentFileSizeAuthor
#1 cache-clear-order-195202-1.patch570 bytespwolanin

Comments

pwolanin’s picture

Status: Active » Needs review
StatusFileSize
new570 bytes

sure - it seems it would guard against such a rare edge case to reverse the order. Trivial patch attached.

Crell’s picture

Status: Needs review » Reviewed & tested by the community

Valid concern, trivially simple fix, applies cleanly.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks. I also added a small bit of comment, so this knowledge is preserved.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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