I am using cakephp to run a multi-tenant application. There is only 1 instance of the app, the only difference being the database each app connects to. Other than that, the app is identical.
My setup:
- Apache 2.2
- Php 5.3
- cake 1.3.10
Win 2k3 server
I have the app deployed under apache's docroot (just 1 instance of the app is running). I recently switched from File to APC cache. The file prefixes for caching are the same for both apps. Using Apache Virtual Hosts to decide which app to go to. I am caching static html/js/css/gif but not php (via apache's mod_expires)
Problem:
I noticed that some of the cached values that were supposed to be available to APP 1 were showing in the dropdown for App 2.I was shocked to see this happen.
How can I add isolation in the APC cache layer between the apps ?
UPDATE: Problem happens even if I make a new copy of the app and put it in its own docroot!!!
UPDATE2
Scenario 1) 1 instance that has all perm/comb
If I have php code like
if(client=="client1") {
$options = array(opt1,opt2);
}else if(client=="client2") {
$options = array(opt3,opt4);
}
and this code is shared by both client 1 and client 2, how will APC caching affect this ?
Scenario 2) 2 instance each customized per client
client1.php
$options = array(opt1,opt2);
client2.php
$options = array(opt3,opt4);
how does this affect APC cache ? If I understand right, for Scenario 1, its possible to have client1 data mix with client 2 (very bad) For Scenario 2, as long as I use different cache keys , am I sure to never have a mixup?