Image

Imagesoltice wrote in Imagephp

Session Caching

Is there any advantage to caching the result of a database query in the session? 

Here's the situation: I'm loading the database information via an object. When initalized, the instance is stored in a static array by rowID. You can get these instances by calling Entry::getInstanceByID($rowID). If the rowID doesn't exist in the array, a new object is initalized from the database. It wouldn't be too difficult to alter this array to store it in the session.

Moreover, the data in the session is managed by my member system. All information stored in the session is automatically deleted every fourty minutes when the member is logged off.