Hi,
Most of my application's operations (including SQL queries and numerical
computation) can be cached. An LRU (least recently used) cache would fit
the bill perfectly.
This LRU cache should be preserved over multiple requests from the same
session. If possible, it should be seen across multiple sessions so that
all users can benefit from it.
I can't implement either solution. In principle I could preserve the
cache across multiple requests by using $_SESSION, but I don't think
this would be wise. The whole structure would weigh on the order of a
MB, so access would probably be really, really slow.
Also consider that access to the cache must be serialized.
I could in principle write the C code to do the caching. But this would
be extremely ugly since I want to cache PHP objects, not C structures.
There would also be the overhead of converting to and from PHP's
representation.
Does anyone have any suggestions? Thanks for your attention.
Best regards,
Flavio Ribeiro
Most of my application's operations (including SQL queries and numerical
computation) can be cached. An LRU (least recently used) cache would fit
the bill perfectly.
This LRU cache should be preserved over multiple requests from the same
session. If possible, it should be seen across multiple sessions so that
all users can benefit from it.
I can't implement either solution. In principle I could preserve the
cache across multiple requests by using $_SESSION, but I don't think
this would be wise. The whole structure would weigh on the order of a
MB, so access would probably be really, really slow.
Also consider that access to the cache must be serialized.
I could in principle write the C code to do the caching. But this would
be extremely ugly since I want to cache PHP objects, not C structures.
There would also be the overhead of converting to and from PHP's
representation.
Does anyone have any suggestions? Thanks for your attention.
Best regards,
Flavio Ribeiro
Comment