Hi,
Is there a mechanism within PHP for sharing data over
multiple requests that are not tied to a specific session.
I need to write a memory senstive cache in pure PHP. I
have an application which needs to store documents
from an application server elsewhere, due to the data
within the documents I can't write them to disk and I
have to minimise the amount of accesses to the server.
So my plan is to write something to store the documents
in a cache avaliable to all requests and store an access
key in the session. When a request is made for a
document that is not in the cache I'll do a quick check
to see if I need to free some space before I add the new
document. However the actual docs to remove will most
likely belong to a different session.
The question is, how do I create an instance of my cache
so it is available over different requests and users.
This was a trivial exercise in a java servlet, however
I now need to use PHP.
Thanks,
Vic
Is there a mechanism within PHP for sharing data over
multiple requests that are not tied to a specific session.
I need to write a memory senstive cache in pure PHP. I
have an application which needs to store documents
from an application server elsewhere, due to the data
within the documents I can't write them to disk and I
have to minimise the amount of accesses to the server.
So my plan is to write something to store the documents
in a cache avaliable to all requests and store an access
key in the session. When a request is made for a
document that is not in the cache I'll do a quick check
to see if I need to free some space before I add the new
document. However the actual docs to remove will most
likely belong to a different session.
The question is, how do I create an instance of my cache
so it is available over different requests and users.
This was a trivial exercise in a java servlet, however
I now need to use PHP.
Thanks,
Vic
Comment