﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30812	ConditionalGetMiddleware returns 304 if ETag is the same but Last-Modified has changed.	Flavio Curella	nobody	"ConditionalGetMiddleware in combination with apache x-sendfile (django-sendfile) doesn't work properly.

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.

Related with #29241."	Bug	new	Core (Cache system)	master	Normal				Accepted	0	0	0	0	0	0
