1. Stefan Scherfke
  2. django-lastfm


Stefan Scherfke  committed f4365b3

Added page caching for lastfm view

  • Participants
  • Parent commits 536b8c9
  • Branches default

Comments (0)

Files changed (1)

File lastfm/views.py

View file
 from django.conf import settings
 from django.http import HttpResponse
 from django.utils import simplejson as json
+from django.views.decorators.cache import cache_page
 URL = 'http://ws.audioscrobbler.com/2.0/?'
 LASTFM_IMG_SIZE = getattr(settings, 'LASTFM_IMG_SIZE', 'large')
+@cache_page(60 * 5)
 def lastfm_data(request):
     """This view retrievs the data from Last.fm and returns a JSON encoded list.
     The template tag’s AJAX code will retrive this list and generate the chart