Forum Moderators: coopster
What I would like is some sort of shared memory array, which is available across php sessions. So in my code I have :
if(isset($my_shared_array[$id])) {
$name = $my_shared_array[$id];
} else {
$my_shared_array[$id] = $db->get_var("select name from idnamemap where id=$id");
$name = $my_shared_array[$id];
}
$my_shared_array is available to all php apps, and doesn't expire when the page finishes running, but is available for the next one that runs as well.
The question is how to do this persistancy stuff? I have looked at the shared memory in php, but I'm not sure if it's what I'm looking for, or how to apply it to my situation.
In a way, it is a kind of db result cache, so maybe something else would work as well.
I'm looking for the method that is the quickest / lowest demanding of system resources.
Andreas
Idealy thered be a "server_session" equilivent of the session functions that can be shared. But thanks, I'll see how I go with shm.