saga
2010-12-21 11:10:11 +08:00
My method, show code:
class Img(PlogRequestHandler):
def get(self, albumidStr, imgidStr, name):
self.response.headers['Content-Type'] = 'text/html;charset=utf-8'
imagecachestring = "ImageA_%s_%s" % (albumidStr, imgidStr)
data = None
try:
data = memcache.get(imagecachestring)
except:
data = None
if data is not None:
self.response.headers['Content-Type'] = 'text/html;charset=utf-8'
self.write(data)
return
......
self.template_values.update({
......
})
pagecontent = self.render('templates/viewimage.html')
memcache.set(imagecachestring, pagecontent, 60)