It looks like the info in the logs could be down to the whole page
processing, but very simple pages (no db) consistently taking 500ms+
Ill give it a try without the zipimport.
I'm just using the loader cache from the cookbook (removed the
bytecode cache), jinja works great, although I did need to force
caching off in dev or the internal caches do not update after template
changes...
import config
import os
import sys
from google.appengine.api import memcache
sys.path.insert(0, 'lib/jinja2.zip')
from jinja2 import Environment, FunctionLoader , TemplateNotFound
def jinja2_template_loader(templatename):
templatepath = os.path.abspath(os.curdir+'/templates/'+templatename)
template = memcache.get(templatepath+config.VERSION)
if template is None:
try:
template = file(templatepath).read()
if config.LIVE:
memcache.set(templatepath+config.VERSION,template)
except:
template = None
return template
if config.LIVE:
jinja2_environment = Environment(loader = FunctionLoader
(jinja2_template_loader),cache_size=50)
else:
jinja2_environment = Environment(loader = FunctionLoader
(jinja2_template_loader),cache_size=0)
def render(template_name,context):
template = jinja2_environment.get_template(template_name)
context["stats"]="LIVE:" +str(config.LIVE) + " DEBUG:" +str
(config.DEBUG)
return template.render(context)