Memcache uses an LRU mechanism, so as long as it is being accessed consistently it shouldn't be evicted. Beyond that, you won't have too much control over keeping an item in the cache, and you might be better off storing it in the datastore with Memcache as a pass-through proxy (read from Memcache first, if it's not there, grab it from the datastore and store it in cache).
On Mon, Mar 1, 2010 at 1:53 PM, xcdesz <[email protected]> wrote: > Thanks for the information. > > So the expiration time is only a maximum time to be stored in the > cache, not an explicit time that you want it to stay. > > If you don't specify an expiration time -- is that like setting an > expiration time of infinity, or is there a default? I'm trying to > maximize the amount of time that the item stays in the cache. > > > On Feb 26, 9:46 am, Barry Hunter <[email protected]> wrote: > > Set the time for as long as you can acceptably use cached data. (days > > if you can) > > > > Just dont expect it to be there all the time, AppEngine can and will > > evict the cache as it needs the memory. > > > > Actual retention is based more on usage of the data rather sticking to > > the expiration time. So data that gets used more will hang around > > longer (upto its expiration time) than rarely used data. (on the basis > > that data that is getting read lots is actully the most useful - its > > saved more hits on the origin datasource) > > > > On 26 February 2010 13:51, xcdesz <[email protected]> wrote: > > > > > Thanks -- that is useful to know. Do you know if there is a maximum > > > expiration time -- for example, if I set expiration to something like > > > 4-8 hours, would that be a bad practice? > > > > > On Feb 26, 4:29 am, Barry Hunter <[email protected]> wrote: > > >> According to the Documentantion theJCacheimplementation is just a > > >> wrapper around memcache > > > > >>http://code.google.com/appengine/docs/java/memcache/ > > > > >> With memcache you explicitly set the expiration time you want on how > > >> long the data should survive for. > > > > >> The 'memory' is actually distributed and lives outside the JVM, so is > > >> shared by all instances (if you have multiple running), and does > > >> survive JVM restarts. > > > > >> On 25 February 2010 20:49, xcdesz <[email protected]> wrote: > > > > >> > I am confused about howJCacheworks with Google's cloud, and have > > >> > some basic questions that I havent been able to find answers for.. > > > > >> > Suppose I am usingJCacheto store query results (i.e; a list of blog > > >> > postings), so that users do not have to hit the datastore when > > >> > initially logging on to a site. If I have a low-traffic situation, > > >> > where one user logs in and logs out after a few minutes, and another > > >> > user might not log on for another hour or so -- do those query > results > > >> > stay inJCachelong enough for the other user to see the cached > > >> > results of the previous user? > > > > >> > I'm trying to reduce the "loading request" time by using cached > > >> > results instead of the datastore. Is this possible, or does the > > >> >JCacheinstance (and JVM, for that matter) die pretty quickly after > > >> > inactivity. DoesJCachelive and die with the JVM -- or is it > > >> > somewhere else? > > > > >> > -- > > >> > You received this message because you are subscribed to the Google > Groups "Google App Engine" group. > > >> > To post to this group, send email to > [email protected]. > > >> > To unsubscribe from this group, send email to > [email protected]<google-appengine%[email protected]> > . > > >> > For more options, visit this group athttp:// > groups.google.com/group/google-appengine?hl=en. > > > > > -- > > > You received this message because you are subscribed to the Google > Groups "Google App Engine" group. > > > To post to this group, send email to [email protected] > . > > > To unsubscribe from this group, send email to > [email protected]<google-appengine%[email protected]> > . > > > For more options, visit this group athttp:// > groups.google.com/group/google-appengine?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-appengine%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- Ikai Lan Developer Programs Engineer, Google App Engine http://googleappengine.blogspot.com | http://twitter.com/app_engine -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
