diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/activity.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/activity.php b/lib/activity.php index e29bc1a25..712800817 100644 --- a/lib/activity.php +++ b/lib/activity.php @@ -329,6 +329,14 @@ class Activity function asString($namespace=false, $author=true) { + $c = Cache::instance(); + + $str = $c->get('activity:as-string:'.Cache::keyize($this->id)); + + if (!empty($str)) { + return $str; + } + $xs = new XMLStringer(true); if ($namespace) { @@ -549,7 +557,11 @@ class Activity $xs->elementEnd('entry'); - return $xs->getString(); + $str = $xs->getString(); + + $c->set('activity:as-string:'.Cache::keyize($this->id), $str); + + return $str; } private function _child($element, $tag, $namespace=self::SPEC) |