It probably depends on the type of application, but memcache does not
help you much if you have a lot of customized output (which are
different
from one user to another).
My application (social network application) has a very similar
requirement,
and I am solving this problem by doing following:
1. Break the data into pieces, so that each data is identical to all
the users,
2. Assign a unique URL to each data, and cache them in memcache using
the URL as the key,
3. Write some JavaScript code on the client side and construct the
custom page
by retrieving those data using AJAX (typically in JSON format, but you
can use HTML-let as well).
In other word, the server side of code is mostly acting as Model (in
MVC), and
the JavaScript code on the client side is acting as Controller.
I found that this architecture works really well with App Engine and
memcache, allowing me
to keep the cache hit rate very high (>95%) and the average access
time to below 100 cpu_ms.
By the way, please aware that you still need to put some access
control on the server side (above memcache).
For example, the "profile of each user" can be accessed via "http://
myapp.appspot.com/profile?uid={user_id}"
(which can be cached in memcache), you want to make it sure that only
friends can access that profile.
Satoshi
On Jan 5, 1:21 pm, dburns <[email protected]> wrote:
> My app may display a lot of different output for a given page
> (customized per user amongst other things), and I'm wondering how best
> to use memcache.
>
> My current scheme is to estimate that a given user's output might be
> useful for, say 10 minutes, after which time the user has probably
> gone away so there's no point caching it. It's not that the content
> is invalid after 10 minutes (I explicitly clear memcache if content
> becomes invalid). Rather, I'm trying to aid memcache in determining
> what it can get rid of.
>
> Is this a good idea, or am I interfering with memcache's algorithm?
> It may all depend on the exact details of the application, but I'm
> wondering if there any general advice on memcache usage.
>
> Thanks.
--
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.