Commits

Marcin Lulek  committed 2270081

add beaker cache region configuration

  • Participants
  • Parent commits fecb7f4

Comments (0)

Files changed (3)

File akhet/paster_templates/akhet/+package+/__init__.py_tmpl

     # Configure Beaker sessions
     session_factory = pyramid_beaker.session_factory_from_settings(settings)
     config.set_session_factory(session_factory)
+    # Configure Beaker cache regions
+    pyramid_beaker.set_cache_regions_from_settings(settings)
 
     # Configure renderers and event subscribers
     config.add_renderer(".html", "pyramid.mako_templating.renderer_factory")

File akhet/paster_templates/akhet/development.ini_tmpl

 session.key = {{project}}
 session.secret = {{random_string}}
 
+#cache
+cache.regions = default_term, second, short_term, long_term
+cache.type = ext:memcached
+cache.url = 127.0.0.1:11211
+cache.lock_dir = %(here)s/data/cache/lock
+cache.second.expire = 1
+cache.short_term.expire = 60
+cache.default_term.expire = 300
+
 
 [pipeline:main]
 pipeline =

File akhet/paster_templates/akhet/production.ini_tmpl

 session.key = {{project}}
 session.secret = {{random_string}}
 
+#cache
+cache.regions = default_term, second, short_term, long_term
+cache.type = ext:memcached
+cache.url = 127.0.0.1:11211
+cache.lock_dir = %(here)s/data/cache/lock
+cache.second.expire = 1
+cache.short_term.expire = 60
+cache.default_term.expire = 300
+
 
 [filter:weberror]
 use = egg:WebError#error_catcher