Skip to content

Instantly share code, notes, and snippets.

@jacobian
Created February 26, 2010 18:19
Show Gist options
  • Save jacobian/315985 to your computer and use it in GitHub Desktop.
Save jacobian/315985 to your computer and use it in GitHub Desktop.
def index(request):
key = 'yabl_author_index'
response = cache.get(key)
if response is None or 'clear_cache' in request.GET:
response = render_to_response(
'authors/index.html',
{'authors': Author.objects.all()},
RequestContext(request),
)
cache.set(key, response, 15)
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment