I am totally confused with CacheMiddleware docs and middleware docs.

I want to use such middlewares in project:
ConditionalGetMiddleware
GZipMiddleware - addes Vary on Accept-Encoding
SessionMiddleware - addes Vary on Cookie
CacheMiddleware -

I am trying to find correct order for this middlewares, according to
http://www.djangoproject.com/documentation/middleware/ the responses
are applied in reverse order.
Cachemiddleware must beaware of Vary headers so it must be applied
after, so the correct would be:
ConditionalGet
CacheMiddleware
SessionMiddleware
GZipMiddleware

But with such order django refuses to work - Exception on learn_key
method.

On the other hand cachemiddleware official docs recommends to put
after all middlewares that changes the Vary header:
ConditionalGet
SessionMiddleware
GZipMiddleware
CacheMiddleware

But how then CacheMiddleware will know about vary headers, they are no
set  when cache middleware applied. Also it caches not compressed
version of document, which is bad.

Please give me some advice what is the correct order


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to