title: How to cache views in django
body: <p>I am currently using django and I'm attempting to cache my view like so </p>
  
  <pre><code>from django.views.decorators.cache import cache_page
  
  @cache_page(60 * 15)
  def index(request):
     # This method takes time to run, which is why I need to cache this view
     a_method_that_preforms_heavy_db_transactions()
  
     context_dict={'Models': Model.objects.all()} 
     return render(request, 'webapp/index.html', context_dict)
  </code></pre>
  
  <p>I have <code>a_method_that_preforms_heavy_db_transactions()</code> In just to test the loading time to see if it cached the view but the loading time time doesn't change when its supposed to be "cached" and I'm unsure why this is my settings.py</p>
  
  <pre><code> CACHES = {
      'default': {
      'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
      'LOCATION': 'My_computers_ip_address:11211',
     }
  }
  </code></pre>