I am trying to reduce the amount of database access by providing a in memory cache. I understand that I can get a cache by using session and cookies, however this only works on a per client basis. if the same query is made once in every session, then the cache will be useless. But I only want to access the database once and have it cached.
Is there a way to make create a cache in memory that can be accessed by the server side script? I don't want to store the cache data in a file ..