ViewCache uses Cache prefixes #430

wants to merge 1 commit into


None yet

4 participants


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

Configure::write('Cache.prefix', 'us')

My cached homepage will end up in:


If I set a different cache prefix (e.g. for another language):

Configure::write('Cache.prefix', 'fr')

My cached homepage for French visitors will end up in:


If no cache prefix is set, it will end up in the default location:


CakePHP member

Are you changing Cache.prefix at bootstrap time?


@markstory Yes, I set it in config/core.php

CakePHP member

this would be the 2.3 version of it:

CakePHP member

This was implemented in 2.3

Thanks for your patch anyway :)

@lorenzo lorenzo closed this Dec 22, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment