on 7/26/2000 12:00 PM, "Nissim Karpenstein" <[EMAIL PROTECTED]> 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.

Totally! Although, I think it should only be done iif they implement an
empty interface ala the way that HttpBindingEventListener (<-stupid name)
works.

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

Seems pretty good!

-jon



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