Caching in Cake is awesome. We like how we can change the cache prefix for different configurations (e.g. language). The ViewCache however, does not follow in this: the cache prefix has no influence on where the cached views are stored. We feel this breaks expected behavior, hence this pull.
If a Configure::read('Cache.prefix') is present, it is appended to the filename of the cached view in TMP/cache/views.
So, if I set
My cached homepage will end up in:
If I set a different cache prefix (e.g. for another language):
My cached homepage for French visitors will end up in:
If no cache prefix is set, it will end up in the default location:
ViewCache now takes Cache prefix into consideration.
Are you changing Cache.prefix at bootstrap time?
@markstory Yes, I set it in config/core.php
I guess it is basically the same idea I had: http://cakephp.lighthouseapp.com/projects/42648/tickets/2251-view-cache-should-support-global-prefix
this would be the 2.3 version of it:
This was implemented in 2.3
Thanks for your patch anyway :)