#27572: Static files served in development should prevent caching
-------------------------------------+-------------------------------------
     Reporter:  Kevin Christopher    |                    Owner:  nobody
  Henry                              |
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  contrib.staticfiles  |                  Version:  1.10
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Old description:



New description:

 Currently, when Django serves static files in development with `runserver`
 and `django.contrib.staticfiles` it doesn't provide any cache headers. In
 their absence, user agents are free to cache the resources
 [https://tools.ietf.org/html/rfc7234#section-4.2.2 however they like].
 That means that when the developer updates a static resource they can't
 predict whether or not they will see the new version or the older cached
 version.

 Dealing with this on the user agent side isn't always easy. For example,
 if you're using an embedded browser in a native app you'll probably have
 to create a remote debugging connection to the app and use platform-
 specific development tools to manipulate or disable the cache.

 Since caching is a performance optimization that makes development more
 difficult and less predictable, I think it makes sense to disable it (via
 the appropriate HTTP headers) for static resources served in development.

--

Comment (by Kevin Christopher Henry):

 (I added the description back in since it was wiped out by the last edit.)

 It looks like the idea of integrating whitenoise hasn't gone anywhere
 since it was [https://groups.google.com/g/django-
 developers/c/N0KbgDeLuUE/m/LXlLqYOWBAAJ last mentioned] in 2017, so I'm
 not sure the resolution makes sense anymnore.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/27572#comment:5>
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/010701860399a8d9-2827fee9-af49-4814-b6ad-7b6f83e04845-000000%40eu-central-1.amazonses.com.

Reply via email to