title: Caching data from other websites in Django
body: <p>Suppose I have a simple view which needs to parse data from an external website.</p>
  
  <p>Right now it looks something like this:</p>
  
  <pre><code>def index(request):
      source = urllib2.urlopen(EXTERNAL_WEBSITE_URL)
      bs = BeautifulSoup.BeautifulSoup(source.read())
      finalList = [] # do whatever with bs to populate the list
      return render_to_response('someTemplate.html', {'finalList': finalList})
  </code></pre>
  
  <p>First of all, is this an acceptable use?</p>
  
  <p>Obviously, this is not good performance-wise. The external website page is pretty big, and I am only extracting a small part of it. I thought of two solutions:</p>
  
  <ol>
  <li>Do all of this asynchronously. Load the rest of the page, populate with data once I get it. But I don't even know where to start. I'm just starting with Django and never done anything async up until now.</li>
  <li>I don't care if this data is updated every 2-3 minutes, so caching is a good solution as well (also saves me the extra round-trips). How would I go about caching this data?</li>
  </ol>