diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Notice.php | 16 | ||||
-rw-r--r-- | classes/Notice_tag.php | 7 |
2 files changed, 23 insertions, 0 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index e72892966..3402e2b30 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -140,6 +140,22 @@ class Notice extends Memcached_DataObject $this->blowNoticeCache(); $this->blowRepliesCache(); $this->blowPublicCache(); + $this->blowTagCache(); + } + + function blowTagCache() { + $cache = common_memcache(); + if ($cache) { + $tag = new Notice_tag(); + $tag->notice_id = $this->id; + if ($tag->find()) { + while ($tag->fetch()) { + $tag->blowCache(); + } + } + $tag->free(); + unset($tag); + } } function blowSubsCache() { diff --git a/classes/Notice_tag.php b/classes/Notice_tag.php index e9f00d6d1..5ab6e332a 100644 --- a/classes/Notice_tag.php +++ b/classes/Notice_tag.php @@ -45,4 +45,11 @@ class Notice_tag extends Memcached_DataObject 'notice_tag:notice_stream:' . $tag, $offset, $limit); } + + function blowCache() { + $cache = common_memcache(); + if ($cache) { + $cache->delete(common_cache_key('notice_tag:notice_stream:' . $this->tag)); + } + } } |