Changes between Initial Version and Version 1 of Ticket #30812
- Timestamp:
- Sep 27, 2019, 1:33:55 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #30812
- Property Triage Stage Unreviewed → Accepted
- Property Summary Return a 304 if ETag is the same but Last-Modified has changed → ConditionalGetMiddleware returns 304 if ETag is the same but Last-Modified has changed.
- Property Version 2.2 → master
-
Ticket #30812 – Description
initial v1 1 split from https://code.djangoproject.com/ticket/29241 1 ConditionalGetMiddleware in combination with apache x-sendfile (django-sendfile) doesn't work properly. 2 3 Each response gets a ETag generated based on response.content which is an empty string in the case of a x-sendfile response, so each time the file is accessed, the ETag generated by `ConditionalGetMiddleware` is the same. Regardless of the changed file/changed mtime. In `get_conditional_response()` the ETag (which is always the same hash of empty string) is checked first and returns a 304 because it ignores `Last-Modified` time. Django shouldn't return 304 if ETag is the same but `Last-Modified` has changed. 4 5 Related with #29241.