Costas Malamas wrote:


Also, in a related thought, have you tried redirecting self.writeln() to stuff HTML into a cache to speed up response time? does that work? it's the next step in my optimization...

each URL is a unique page - look for the rendered page in the cache. If not, render it from a cheetah template


def writeHTML(self):
servletCache = self.servletCache
if 1:
try:
print 'cache hit'
self.write(servletCache.get(self.request().serverURL() + "asdasd",10))
except KeyError:
print 'cache miss'
templateFile=os.path.join(os.path.dirname(os.path.dirname(self.serverSidePath())),r'templates',self.TemplateName)
templateFileName = os.path.split(templateFile)[1]
t = Template(file=templateFile, searchList=[self.getPageData()])
print 'compiled template'
servletCache.set(templateFileName,t,10)
t.contentBox = self.pageContents()
self.write(t)
servletCache.set(self.request().serverURL(),str(t),10)



-Aaron




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to