I *believe* you can "putAll" the values first so there's an expiration, then
the increment will respect that.

A different implementation might be to use the minute in the Memcache key
itself. I've used this in the past for throttling. You'd have a memcache key
with something like:

"2011-08-12-14-08-user-id-123"

Since Memcache will automatically expire these for you via LRU, you don't
have to worry about garbage collecting these values.

--
Ikai Lan
Developer Programs Engineer, Google App Engine
plus.ikailan.com | twitter.com/ikai



On Fri, Aug 5, 2011 at 3:26 PM, Wo josh <[email protected]> wrote:

> I am trying to use increment feature of the memcacheService so that i can
> implement captcha for users trying to post n times within x seconds. It will
> be nice if I can set an expiration on the cache. Would the App Engine team
> like to consider? Anyone else wants to vote for this feature please comment!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine-java/-/X3hSyGKlN74J.
> 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-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 [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-java?hl=en.

Reply via email to