Permalink
Browse files

Comment Pane Cache: make cache lifetime configurable in INI.

This allows us to independently vary it on some servers via ini file
(i.e. fastlane).
  • Loading branch information...
1 parent 3812f7b commit a8c6631c40694383f3348c028f8cabdfc7758d22 @spladug spladug committed Aug 28, 2012
Showing with 5 additions and 1 deletion.
  1. +2 −0 r2/example.ini
  2. +1 −0 r2/r2/lib/app_globals.py
  3. +2 −1 r2/r2/lib/pages/pages.py
View
2 r2/example.ini
@@ -88,6 +88,8 @@ default_header_url = reddit.com.header.png
# time for the page cache (for unlogged in users)
page_cache_time = 90
+# time for the comment pane cache (for a subset of logged in users, see pages.py:CommentPane)
+commentpane_cache_time = 120
# default localization for strings (when using python's locale.format)
locale = C
View
1 r2/r2/lib/app_globals.py
@@ -72,6 +72,7 @@ class Globals(object):
'db_pool_size',
'db_pool_overflow_size',
'page_cache_time',
+ 'commentpane_cache_time',
'num_mc_clients',
'MIN_DOWN_LINK',
'MIN_UP_KARMA',
View
3 r2/r2/lib/pages/pages.py
@@ -1096,7 +1096,8 @@ def renderer():
# render as if not logged in (but possibly with reply buttons)
self.rendered = renderer().render()
- g.cache.set(key, self.rendered, time = 120)
+ g.cache.set(key, self.rendered,
+ time=g.commentpane_cache_time)
finally:
# undo the spoofing

0 comments on commit a8c6631

Please sign in to comment.