﻿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
18473	Contradictory advice on middleware order	david@…	nobody	"From https://docs.djangoproject.com/en/dev/ref/middleware/#django.middleware.gzip.GZipMiddleware
  It is suggested to place this first in the middleware list, so that the compression
  of the response content is the last thing that happens.

From https://docs.djangoproject.com/en/dev/topics/cache/#order-of-middleware-classes
  you need to make sure that !UpdateCacheMiddleware appears before any other middleware
  that might add something to the Vary header. The following middleware modules do so:

    !SessionMiddleware adds Cookie \\
    GZipMiddleware adds Accept-Encoding


I suspect https://docs.djangoproject.com/en/dev/ref/middleware/#django.middleware.gzip.GZipMiddleware might need to be changed. With GZipMiddleware first, not only will it alter the ""Vary"" header handling, but presumably it will be recompressing the uncompressed cached content on each request, and it would be better to cache the compressed content instead.
"	Bug	closed	Documentation	1.4	Normal	fixed	middleware order GZipMiddleware UpdateCacheMiddleware		Accepted	0	0	0	0	0	0
