下面给出了写出我的静态首页的类。谷歌建议使用内存缓存静态页面以获得更好的性能,但我不知道如何去做。有什么建议么?
class MainHandler(webapp2.RequestHandler):
def get (self, q):
if q is None:
q = 'index.html'
path = os.path.join (os.path.dirname (__file__), q)
self.response.headers ['Content-Type'] = 'text/html'
self.response.write (template.render (path, {}))