#32891: runserver serve static files cached in debug
-------------------------------------+-------------------------------------
Reporter: TZanke | Owner: TZanke
Type: Bug | Status: closed
Component: contrib.staticfiles | Version: 3.2
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by TZanke):
Hello Carlton,
my (and my coworkers) expected behavior, with DEBUG=True, was a non-cached
js/css file. So while developing, new colleges always struggle debugging,
cause "my files does not get refreshed, but debug is on! Help me!". Yeah
no problem, we always use the "disable browser cache" but maybe we are not
alone with this problem, and this could easily be fixed. Cause `static.py
serve` only is used in Debug mode by Django.
But we will respect the decision made.
> If you really wanted to add no cache headers you could do so in a
middleware, but I don't think it's appropriate for projects in general.
I've tried, but its not working. `static.py serve` is called within the
'StaticFilesHandler', skipping the Middlewares from `BaseHandler`.
See:
https://github.com/django/django/blob/main/django/contrib/staticfiles/handlers.py#L53
No super call, no Middleware execution.
But keep in mind, i am not able to test with a new Django version right
now. Maybe i am wrong 'just lookin at github'. But in Django 1.11
Middlewares are skipped.
(And yees, we are are nearly finished with Python3 conversion, so Django
2/3 is coming...soon ;)
Best regards
Tobias
--
Ticket URL: <https://code.djangoproject.com/ticket/32891#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.970d392baa8b0a1d9e2926711ffde341%40djangoproject.com.