Skip to content

Instantly share code, notes, and snippets.

View beaumartinez's full-sized avatar
😂
I don't use GitHub

Beau beaumartinez

😂
I don't use GitHub
View GitHub Profile
@beaumartinez
beaumartinez / gaecache.py
Created August 9, 2011 21:15
Use GAE's Memcache to cache functions
import google.appengine.api.memcache
DEFAULT_CACHE_TTL = 60 * 60 * 24
def cache(function, ttl=DEFAULT_CACHE_TTL):
'''Cache `function` and its arguments for `ttl` seconds in GAE's
Memcache.
Usable as a decorator.
'''