Hopefully it reduces the overhead over the course of a session. It seems better than pre-loading everything that might be needed into the instance for every request, or calling the DB for each piece individually as it is requested over the course of the session.
- Look as close to home as possible first (memory->cache->DB)
- Trade a little memory/storage space for the length of the request/session to cut down on DB calls.
- Try to avoid DB calls by retrieving relevant info on the first call.
- Reusable data migrates into the cache, and lives there until the session ends- hopefully quicker and lower cost than DB calls.
I'm using a persistant dbhandle (or it WILL persist when I get this onto mod_perl). But calling also requires figuring out where to get the data from, forming the request, dealing with the call...