Skip to content

Commit

Permalink
passing TTL of cache properly now.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinabrahms committed Feb 3, 2011
1 parent 61c6eb6 commit d77588d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion django_website/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ def recent_release(request):
recent_release = cache.get('recent_release')
if not recent_release:
recent_release = DocumentRelease.objects.default().version
cache.set('recent_release', recent_release)
cache.set(
'%s_recent_release' % settings.CACHE_MIDDLEWARE_KEY_PREFIX,
recent_release,
settings.CACHE_MIDDLEWARE_SECONDS,
)
return {'RECENT_RELEASE': recent_release}

0 comments on commit d77588d

Please sign in to comment.