Changes between Initial Version and Version 1 of Ticket #30812


Ignore:
Timestamp:
Sep 27, 2019, 1:33:55 AM (5 years ago)
Author:
Mariusz Felisiak
Comment:

Thanks for the ticket (please try to add more descriptive description in the future).

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30812

    • Property Triage Stage UnreviewedAccepted
    • Property Summary Return a 304 if ETag is the same but Last-Modified has changedConditionalGetMiddleware returns 304 if ETag is the same but Last-Modified has changed.
    • Property Version 2.2master
  • Ticket #30812 – Description

    initial v1  
    1 split from https://code.djangoproject.com/ticket/29241
     1ConditionalGetMiddleware in combination with apache x-sendfile (django-sendfile) doesn't work properly.
     2
     3Each 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
     5Related with #29241.
Back to Top