[IMP] Increase statics cache from 12 hours to 1 week
This commit is contained in:
parent
6b15d3add2
commit
34c5a5cf9c
|
@ -41,6 +41,9 @@ from openerp.tools.func import lazy_property
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
# 1 week cache for statics as advised by Google Page Speed
|
||||||
|
STATIC_CACHE = 60 * 60 * 24 * 7
|
||||||
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
# RequestHandler
|
# RequestHandler
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
|
@ -1192,7 +1195,7 @@ class Root(object):
|
||||||
|
|
||||||
if statics:
|
if statics:
|
||||||
_logger.info("HTTP Configuring static files")
|
_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)
|
self.dispatch = DisableCacheMiddleware(app)
|
||||||
|
|
||||||
def setup_session(self, httprequest):
|
def setup_session(self, httprequest):
|
||||||
|
|
Loading…
Reference in New Issue