Confirmed users
1,209
edits
(parent callback explanation: bug 456090.) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
In {{bug|425315}}/ | In {{bug|425315}}/{{SVN|18173}}, a new object-based memcaching framework landed. This page outlines the basic concepts and use instructions. | ||
== Basic concepts == | == Basic concepts == | ||
Line 33: | Line 33: | ||
// put a list ID on the list of lists to delete off the cache (6) | // put a list ID on the list of lists to delete off the cache (6) | ||
$this->Cache->markListForFlush("addon:{$this->id}"); | $this->Cache->markListForFlush("addon:{$this->id}"); | ||
// as always, remember to call the parent's callback before returning (7) | |||
return parent::afterSave(); | |||
} | } | ||
Line 63: | Line 65: | ||
=== 6: instant cache invalidation === | === 6: instant cache invalidation === | ||
At write time, we use markListForFlush() to mark one or more of the expiration list IDs for flushing. Each of these lists will be looped through and each contained object ID will be deleted from memcache. | At write time, we use markListForFlush() to mark one or more of the expiration list IDs for flushing. Each of these lists will be looped through and each contained object ID will be deleted from memcache. | ||
=== 7: parent callback === | |||
Our app_model contains code for the translation framework. Failure to call the parent's afterSave() callback after it was overwritten in the Addon model caused translations not to be saved ({{bug|456090}}), so... remember to do that. |