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?
>
Sounds like a good idea to me. I think that this would work well. I
like the idea of an auto refresh. In some apps this could give the end
user the illusion of a faster application. Cool.
While things are being rethought in this area, it would also be really
good to add a refreshCache() method to TurbineGlobalCacheService so that
you could make one call to refresh the complete cache without restarting
the app.
John
--
********************************
** John Thorhauer
** [EMAIL PROTECTED]
********************************
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]