My apologies, I should have written the documentation long ago but it appears the task was a bit like kryptonite to me, there was always something to distract me/pull me away.
I've made a start into it today, dedicating much of the day to it - you can see where I'm up to here:
http://docs.moodle.org/dev/User:Sam_Hemelryk/Caching
It is still a work in progress - I will dedicating all the time I can to it tomorrow. Once finished it will be moved into the version documentation where it belongs (after I get Helen to aid me in fixing it up)
In answer to your question:
MUC allows for one or more cache store instances to be mapped to a cache definition. This is basically saying you can use one or more backends to store data for a single cache.
If multiple stores have been mapped the following occurs:
* When looking for something in the cache the stores get chained in the order they are mapped. First MUC looks at the primary store. If the primary store doesn't have the data then the primary store looks at the next store in the chain, and so on until either it is found in one of the chained stores or there are no more stores to search.
If it is found in a store down the chain then each store back up the chain sets it before returning it.
* When something gets sent to the cache every store in the chain gets called to cache the data. Thus everyone in the map is aware of it at the time that is stored.
In most situations one store is all you need, however there are situations where having multiple can be worked to improve performance.
For instance, if you have a memcache server with limited space and a large site (or at least a large cache) you can configure the primary cache to memcache, and the final cache to the default file store cache.
When memcache fills up and is then asked to cache more it drops stored data in order to make space. It has the advantage of being fast, but the disadvantage of limited in size.
By mapping memcache as the primary and file as the secondary you reduce the chances of encounter cache misses because even if memcache has got rid of something to make room for other data what you're looking for may still exist in the file cache.
This would also be useful for a site that was using a memcache server used by other sites/programs/things.
I hope that answers your question, and thank you Tim for bringing this to my attention (really for chasing me up)
Regards
Sam Hemelryk