Albert
Albert

Reputation: 3651

Get a random item from Memcache - Google App Engine

Is there any way to get a random item from memcache?

Upvotes: 1

Views: 1078

Answers (2)

Nick Johnson
Nick Johnson

Reputation: 101149

No, there's no way to select a random element from memcache. It's not designed for that, either.

Upvotes: 2

Peter Knego
Peter Knego

Reputation: 80340

Not directly via API.

But you could create a list of image keys for all images in memcache and then randomly select from that list. The list itself would also need to me stored in memcache.

Upvotes: 3

Related Questions