I think Google as a company tries to make everything simple. I love how easy they make caching integration with their platform.
As a simple example, let’s just say you want to cache the home page to your web site for 24 hours. If your home page doesn’t change often, but is rather intensive to load when someone asks for it, caching it will speed things up pretty dramatically for anyone that accesses it later.
In this case, the previously rendered HTML is loaded from cache if available. Otherwise, the HTML is rendered from a Jinja template, stored in cache for the next time and then provided. Simple.
from google.appengine.api import memcache if memcache.get('yourindexpage'): self.response.out.write(memcache.get('yourindexpage')) else: template = jinja_environment.get_template('/index.html') renderedhtml = template.render() memcache.set('yourindexpage', renderedhtml, 86400) self.response.out.write(renderedhtml)