Is there an easy way to turn off caching of static files in Django's development server?
I'm starting the server with the standard command:
$ python manage.py runserver
I've got settings.py configured to serve up static files from the /static directory of my Django project. I've also got a middleware class that sets the Cache-Control header to must-revalidate, no-cache for development, but that only seems to affect URLs that are not in my /static directory.
settings.py
/static
Cache-Control
must-revalidate, no-cache
Assuming you're using django.views.static.serve, it doesn't look like it - but writing your own view that just calls django.views.static.serve, adding the Cache-Control header should be rather easy.
django.views.static.serve
1.4m articles
1.4m replys
5 comments
57.0k users