Persistent objects?
Posted: Thu Oct 04, 2007 6:16 pm
I'm trying to maintain a lot of common objects that will be used by many pages, but am trying to avoid the hit of reloading the information from a file or database for every page request.
For example, if I want to build an NLS such that I can make a call to get a phrase/word in a particular language, it will require maintaining a translation file with 1,000 terms and every time a page is requested, I want to just have that in memory for quick access rather than rereading it from disk/database.
Another example is I have global properties for my web site that are stored in the database, but they are used so frequently that I'd like to avoid the current overhead of querying the database on every page request.
Any suggestions on how to do this?
(Moderators, I'm not sure if this posting should be under Theory and Design - please feel free to move this to the appropriate location)
For example, if I want to build an NLS such that I can make a call to get a phrase/word in a particular language, it will require maintaining a translation file with 1,000 terms and every time a page is requested, I want to just have that in memory for quick access rather than rereading it from disk/database.
Another example is I have global properties for my web site that are stored in the database, but they are used so frequently that I'd like to avoid the current overhead of querying the database on every page request.
Any suggestions on how to do this?
(Moderators, I'm not sure if this posting should be under Theory and Design - please feel free to move this to the appropriate location)