From 34c5a5cf9ccf3f0e76688ecc22d16749c005c56b Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 27 Aug 2014 16:54:25 +0200 Subject: [PATCH] [IMP] Increase statics cache from 12 hours to 1 week --- openerp/http.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openerp/http.py b/openerp/http.py index c154330b059..6ae15f5a477 100644 --- a/openerp/http.py +++ b/openerp/http.py @@ -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):