Nissim Karpenstein wrote:
> 
> What do you think of making the cache work in such a way that instead of
> removing items from the cache when they expire, you can ask them to refresh
> themselves.  For example, if I have the 7 most recent stories displaying on
> the main page, I want to query for those seven stories once every 3 minutes,
> rather than removing them from the cache every three minutes.
> 
> Otherwise (with the exisitng functionality), when 3 minutes is up, the
> stories are removed from the cache, and then the next request for the main
> page has to wait for the query to execute, and the objects to be
> created...my way the database hit is taken by the background thread rather
> than by the request thread.
> 
> I was thinking you coupld implement this by extending CachedObject, making
> RefreshableCachedObject which would take a RefreshableObject as the
> constructor parameter.  The RefreshableObject interface would force
> implementors to have a refresh method.
> 
> Then when the thread goes through the cached objects, and the time has
> expired, if its instanceof CachedObject, it's removed, but if it's
> instanceof RefreshableCachedObject, it's refreshed.
> 
> What do you all think of that?

+1 Nissim, truly excellent suggestions.

I've also been considering making the database connection pool use the
global cache functionality internally.
-- 

Daniel Rall <[EMAIL PROTECTED]>


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to