croogo/croogo — pull request #162 by rchavik (2013-04-30 06:54:53+00:00)
Title: 1.5 cache groups

I've been trying to fix http://croogo.lighthouseapp.com/projects/32818/tickets/376 in a backward compatible way, but did not find a clean solution.

The difficulties I encountered with the current implementation:
- 'prefix' based, meaning each model has to register all known prefix. Hence, adding a new prefix would require updating the model's prefix list.
- CachedBehavior has no implicit knowledge of the actual Cache config names. When using the FileEngine, it was possible to do because clearing uses prefix globbing
- Only works with FileEngine
- Writing and clearing are handled by two different components: Croogo.Model/CroogoAppModel and Croogo.Behavior/CachedBehavior

This PR attempts to solve the issue by converting all 'prefix' style caching:
- No more Cache 'prefix', instead 'groups' are used. Although model still needs to register the group, creating a new prefix is easier.
- CroogoCache that extends Cakephp's Cache class. This class is an interim solution for Cakephp <2.4 and would be unnecessary once cakephp#1256 is merged.
- Supports engines other than File, eg: Redis, Memcached

To minimize impact for next release, I did not modify the cache generation mechanism, ie: in CroogoAppModel, and clearing in CachedBehavior. However, we should try to improve that in the next version