Memcached Namespaces
If Memcached is installed and the Blörg application has enabled memcache, some values are cached. Values are cached in the following namespaces. Each namespace additionally lists actions cause the cached values for the namespace to be cleared. If developing Blörg code, caching may use these namespaces where appropriate or may define a new namespace.
Note that some actions may clear the cache for multiple namespaces.
-
posts
- edit a post
- add a post
- edit tag (may belong to a post)
- edit author (may belong to a post)
- add a comment
- edit a comment
-
tags
- tag a post
- untag a post
- add a tag
- edit a tag
-
authors
- edit a post's author
- add a post
- add an author
- edit an author
Additionally, the following values are cached (not in a namespace):
-
gadget_instances
- edit gadget settings
- add gadget
- remove gadget
-
instance_config_settings
- edit preferences
-
config_settings
- edit preferences
Sometimes, a cached value doesn't fall neatly into one of these categories,
it may overlap two or more categories. For example, the
BlorgActiveConversations gadget cache depends on both the
posts
namespace and the gadget_instances
value. To solve this,
we do the following:
- if
getValue('limit')
is not equal to the cached valueactive_conversations_limit
, clearactive_conversations
from theposts
namespace - cache
getValue('limit')
as the valueactive_conversations_limit
- cache
active_conversations
in theposts
namespace
This requires an extra cache value that is not in any namespace. If the
posts
namespace is cleared, the cached active conversations are also
cleared. If the gadget_instances
value is cleared and the new value of
the limit
gadget setting is not equal to the cached value, the active
conversations are also cleared.