Author: tmckay
Date: 2011-02-11 18:28:47 +0000 (Fri, 11 Feb 2011)
New Revision: 4519
Modified:
trunk/wooly/python/wooly/pages.py
Log:
Improve cumin web server performance by adding Cache-Control max-age=N headers for static
pages.
BZ676902
Modified: trunk/wooly/python/wooly/pages.py
===================================================================
--- trunk/wooly/python/wooly/pages.py 2011-02-11 17:26:52 UTC (rev 4518)
+++ trunk/wooly/python/wooly/pages.py 2011-02-11 18:28:47 UTC (rev 4519)
@@ -258,6 +258,9 @@
def get_content_type(self, session):
return "text/css"
+ def get_cache_control(self, session):
+ return "max-age=86400"
+
def get_css(self):
if not self.__css:
writer = Writer()
@@ -297,6 +300,9 @@
def get_content_type(self, session):
return "text/javascript"
+ def get_cache_control(self, session):
+ return "max-age=86400"
+
def get_javascript(self):
if not self.__javascript:
writer = Writer()
@@ -344,6 +350,9 @@
def get_last_modified(self, session):
return self.then
+ def get_cache_control(self, session):
+ return "max-age=86400"
+
def get_content_type(self, session):
name = self.rname.get(session)
base, ext = os.path.splitext(name)
Show replies by date