Sounds like you could just keep it around for 30 minutes or an hour,
refreshing it after it expires.

What would be nice is to be able to perform the refresh asynchronously.  Say
it takes 5s to build a piece of data that every appserver uses for
practically every request.  Instead of relying on memcache, it would be nice
to just keep this as static/application-scoped data in the appserver - and
have a cron job that updates every instance every 15 minutes or so.

This is easy to do if I can create threads, and a common pattern in the
JavaEE world.

Jeff

On Tue, Jun 14, 2011 at 8:25 AM, tempy <fay...@gmail.com> wrote:

> Hello all,
> I'm wondering if its possible to design a cache using data in static
> variables.  I have certain pieces of small and unchanging data, such
> as a banner for the top of the site whose contents might only change
> every couple of days.  This is perfect for storing in a static
> variable and falling back onto the memcache as necessary.  The one
> thing I don't know how to do is to clear that cache.  If I want to
> update that data, I can clear the memcache, but there's no way that I
> can think of to clear static data cache, other than to wait until a
> particular instance goes down, and who knows when that will happen.
> Any ideas?  Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to