memcache - best practice

Marcus Bointon marcus at synchromedia.co.uk
Fri Sep 15 09:41:05 UTC 2006


On 15 Sep 2006, at 10:11, Johannes Fosseus wrote:

> If I have an object that I regenerate every 15 seconds, is that object
> worth caching or do the process of caching take more power that I will
> benefit from the cache object?

That should be a simple calculation. Looking at how often it gets  
read and how long it takes to generate should give you a breakpoint  
after which caching it is necessary (not just worthwhile). If it  
takes 1 second to generate then the fastest you can service hits for  
it is obviously 1 per second. A cached version is going to be much,  
much faster to access as you won't incur the generation overhead  
every time. I'm just converting some queries to only cache results  
for 10 sec on a similar basis.

Marcus
-- 
Marcus Bointon
Synchromedia Limited: Creators of http://www.smartmessages.net/
marcus at synchromedia.co.uk | http://www.synchromedia.co.uk/




More information about the memcached mailing list