In a CakePHP (2.1) app I'm using themes together with cacheAction. When accessing the view of e.g. /controller/action, its cache file is saved to tmp/views/controller_action.php. When accessing the same view from a mobile url (like m.example.com), I internally use the same app with themed views to simplify the output for the mobile device.
But now there is a problem with the cache: both requests have different hostnames and themes, but the same controller/action and therefore the same filename of the cache files. So when accessing the urls with different hosts or themes, CakePHP returns the same cache file (or more precisely the cache file of the first request). It is not possible to change the name of the cache files depending on a parameter (e.g. hostname or theme).
I tried modifying the parameters of CacheHelper, but without success. Is there a way to change the cache path/prefix for CacheHelper on the fly? Or is there another possibility to realize this behavior?