[IMP] Increase statics cache from 12 hours to 1 week

This commit is contained in:
Fabien Meghazi 2014-08-27 16:54:25 +02:00
parent 6b15d3add2
commit 34c5a5cf9c
1 changed files with 4 additions and 1 deletions

View File

@ -41,6 +41,9 @@ from openerp.tools.func import lazy_property
_logger = logging.getLogger(__name__)
# 1 week cache for statics as advised by Google Page Speed
STATIC_CACHE = 60 * 60 * 24 * 7
#----------------------------------------------------------
# RequestHandler
#----------------------------------------------------------
@ -1192,7 +1195,7 @@ class Root(object):
if statics:
_logger.info("HTTP Configuring static files")
app = werkzeug.wsgi.SharedDataMiddleware(self.dispatch, statics)
app = werkzeug.wsgi.SharedDataMiddleware(self.dispatch, statics, cache_timeout=STATIC_CACHE)
self.dispatch = DisableCacheMiddleware(app)
def setup_session(self, httprequest):