Not sure what you're using to access the datastore but assuming it's objectify, have you looked at this doc <https://github.com/objectify/objectify/wiki/Caching#global-cache>? Your "get by key" entities could be automatically cached anyway.
Also, as stated here <https://cloud.google.com/appengine/docs/java/memcache/>: > be sure that your application behaves acceptably when the memcache value > is suddenly not available. Values can expire from the memcache at any time, > and may be expired prior to the expiration deadline set for the value So it's probably not a good idea to export something to memcache once a day as it's not guaranteed that your data will stay there for any amount of time at all (also, it's not clear what you mean by "accessing memcache directly from the front-end", how would you go about that?). Instead, you could implement a handler on java end that will check some memcache keys and if the data exist - return it to the user but if the data doesn't exist - query the datastore, store the result in the memcache for next requests and return the data to the user. This, depending on the usage and the implementation could save you a lot of datastore reads but ofcourse check the above links for possible caveats. Thanks, Mihail. On Thursday, July 30, 2015 at 7:44:44 AM UTC+3, Keith Chima wrote: > > So I have a rest service that is powered by the datastore. We have a > angular front-end and java backend, and use REST to access the datastore > data. To keep the front-end up-to-date, I want to access the datastore data > once per day, and store once per day. > > I assume I should access it once at the beginning of the day and store it > in the memcache. Then, I should access the memcache every time a user loads > the page. > > Assuming this is correct, should I access the memcache from the java end > and make a rest call every time the user loads the page, or should I access > the memcache directly from the front-end? > > Thanks, > -Keith > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/7c8cf831-35e9-4145-9e02-ac43648e4901%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
