title: Setting up cache with Django to work around the "page has expired" IE problem
body: <p>I have got a familiar problem. I am using Django-0.97, and cannot upgrade -- though the version of Django being used should not play any part in the cause of the problem.</p>
  
  <p>I have a search view that presents a form to the user, and, on submission of the form via POST, performs heavy computations and displays a list of items that are generated as a result of those computations. Users may click on the "more info" link of any of those items to view the item detail page. </p>
  
  <p>Users on <strong>IE</strong>, once they are on the item detail page for any item from the search results page, get the <a href="http://support.microsoft.com/kb/183763" rel="nofollow noreferrer">familiar</a> "webpage has expired, click on refresh button, yadda yadda yadda" error <strong>when</strong> they hit the "<em>back</em>" button on the browser. Sadly, a good majority of the users of the site use IE, are not tech savvy, and are complaining about this problem.</p>
  
  <p>Thinking that setting up a <a href="http://docs.djangoproject.com/en/dev/topics/cache/" rel="nofollow noreferrer">cache backend</a> may solve the problem, I configured a simple cache backend. I juggled with per-site cache and per-view cache, but to no avail. And now, I am not too sure I have set up the cache stuff properly.</p>
  
  <p>Any hints, suggestions that may help in mitigating the problem will be hugely appreciated. </p>
  
  <p>Thanks.</p>
  
  <p><strong>UPDATE (20 July 2009)</strong></p>
  
  <p>I have used Fiddler to inspect the HTTP headers of both the request and response. IE is sending the <code>Pragma: no-cache</code> header in the POST request. The HTTP response generated as a result of the request has the following headers: </p>
  
  <pre><code>Cache-Control: public, max-age=3600
  Date: someDateHere
  Vary: Cookie
  </code></pre>
  
  <p>And, yes, I am not using the PRG pattern. </p>