summaryrefslogtreecommitdiff
path: root/classes/Notice.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Notice.php')
-rw-r--r--classes/Notice.php25
1 files changed, 24 insertions, 1 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 5fa0d79a1..fbfeb9489 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -207,7 +207,11 @@ class Notice extends Memcached_DataObject
# XXX: someone clever could prepend instead of clearing the cache
if (common_config('memcached', 'enabled')) {
- $notice->blowCaches();
+ if (common_config('queues', 'enabled')) {
+ $notice->blowAuthorCaches();
+ } else {
+ $notice->blowCaches();
+ }
}
return $notice;
@@ -271,6 +275,25 @@ class Notice extends Memcached_DataObject
$this->blowGroupCache($blowLast);
}
+ function blowAuthorCaches($blowLast=false)
+ {
+ // Clear the user's cache
+ $cache = common_memcache();
+ if ($cache) {
+ $user = User::staticGet($this->profile_id);
+ if (!empty($user)) {
+ $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id));
+ if ($blowLast) {
+ $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id . ';last'));
+ }
+ }
+ $user->free();
+ unset($user);
+ }
+ $this->blowNoticeCache($blowLast);
+ $this->blowPublicCache($blowLast);
+ }
+
function blowGroupCache($blowLast=false)
{
$cache = common_memcache();