Django

Code

Ticket #4943 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

Cache middleware description

Reported by: anonymous Assigned to: nobody
Milestone: Component: Documentation
Version: SVN Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Original text: Order of MIDDLEWARE_CLASSES

If you use CacheMiddleware?, it’s important to put it in the right place within the MIDDLEWARE_CLASSES setting, because the cache middleware needs to know which headers by which to vary the cache storage. Middleware always adds something to the Vary response header when it can.

Put the CacheMiddleware? after any middlewares that might add something to the Vary header. The following middlewares do so: SessionMiddleware? adds Cookie GZipMiddleware adds Accept-Encoding



First, the list lacks LocaleMiddleware? as it adds vary Accept-Language. Second, the responce is handled by middleware in reverse order, hence CacheMiddle? must be placed BEFORE any middleware that change vary header.

Attachments

4943.patch (1.1 kB) - added by SmileyChris on 10/16/07 18:31:37.

Change History

10/16/07 18:31:37 changed by SmileyChris

  • attachment 4943.patch added.

10/16/07 18:32:16 changed by SmileyChris

  • needs_better_patch changed.
  • stage changed from Unreviewed to Ready for checkin.
  • needs_tests changed.
  • needs_docs changed.

10/21/07 07:14:18 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [6575], although I typed the wrong ticket number in the commit message.


Add/Change #4943 (Cache middleware description)




Change Properties
Action