djangocachingdjango-dev-server

In Django 1.3 alpha 1, does the built-in web server cache pages (or database results) more aggressively than before?


I’m using Django version 1.3 alpha 1 (SVN-14750) to build a Django site.

I’ve got a couple of pages which display data, and allow me to edit that data. However, I seem to have to restart the built-in Django web server to see the updated data.

I don’t remember having this problem before: usually a CTRL + F5 refresh in the browser would do it. Obviously, it’s quite annoying behaviour during development, seeing up-to-date data load slower is preferable to seeing out-of-date data load instantly.

I’m using Firefox with the cache disabled (about:config, network.http.use-cache=False), so I’m reasonably sure the issue is with Django.


Solution

  • Ah — I still had some cache middleware enabled. Removing the following from my MIDDLEWARE_CLASSES setting in settings.py fixed it.

    'django.middleware.cache.UpdateCacheMiddleware',
    'django.middleware.cache.FetchFromCacheMiddleware',
    

    (As is probably evident from the question and this answer, I don’t understand caching, Django or otherwise, very well.)