I am using the default Codeigniter page cache e.g.:
$this->output->cache(n);
My problem is that I am using this within two different controllers and getting a duplicate cached page i.e. the same page being returned for both. I believe this is due to using a subdomain e.g:
mobile.mysite.com => Controller 1
mysite.com => Controller 2
When I enable the cache on both, i get the same page returned.
How can I generate a different cache for each?
Regards, Ben.
By default the output cache is controller based. So as you see if a controller is named the same then it will generate or use the same cache (if you cache directory is the same in both places).
Your best workaround is using the cache driver and storing your cache manually. Here is an example of the controller code: