diff --git a/development.ini b/development.ini index 406c35e..c0ea66d 100644 --- a/development.ini +++ b/development.ini @@ -25,6 +25,7 @@ sqlalchemy.url = sqlite:///%(here)s/ordr2.sqlite auth.secret = 'Change Me 1' session.secret = 'Change Me 2' session.auto_csrf = true +static_views.cache_max_age = 0 ### # wsgi server configuration diff --git a/ordr2/views/__init__.py b/ordr2/views/__init__.py index c4da379..e903c81 100644 --- a/ordr2/views/__init__.py +++ b/ordr2/views/__init__.py @@ -14,6 +14,9 @@ def includeme(config): ''' adding request helpers and static views ''' config.add_request_method(flash, 'flash') - config.add_static_view('static', 'ordr2:static', cache_max_age=3600) - config.add_static_view('deform', 'deform:static') + settings = config.get_settings() + age = int(settings.get('static_views.cache_max_age', 3600)) + + config.add_static_view('static', 'ordr2:static', cache_max_age=age) + config.add_static_view('deform', 'deform:static', cache_max_age=age)