Created
July 1, 2013 15:27
-
-
Save scottsappen/5901839 to your computer and use it in GitHub Desktop.
Google Memcache is super simple - example with a jinja template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment