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?
-Nissim
> -----Original Message-----
> From: Jon Stevens [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 26, 2000 2:44 PM
> To: Turbine
> Subject: Re: global cache functionality?
>
>
> on 7/26/2000 11:01 AM, "John Thorhauer"
> <[EMAIL PROTECTED]> wrote:
>
> > 1. Is there a way to make the cache so that the info in the
> cache never
> > expires? In other words, I want to load some data into global cache
> > when my app is started up and then leave it in there as
> long as the app
> > is running. Is this possible?
>
> You do have the source code. :-) I *believe* that you can
> either set it to
> some huge integer or simply set it to 0.
>
> > 2. I also want to be able to "refresh" an object after it
> has been put
> > in the cache. Can this be done by simply overwriting the
> object with a
> > new object with the same name?
>
> Yes, I believe so.
>
> -jon
>
>
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?: [EMAIL PROTECTED]
>
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]