Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: To cache or not to cache

by blogical (Pilgrim)
on Mar 13, 2006 at 18:12 UTC ( [id://536331]=note: print w/replies, xml ) Need Help??


in reply to Re: To cache or not to cache
in thread To cache or not to cache

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...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://536331]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-16 07:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found