Permalink
Browse files

Fix middleware and illustrate middleware order

  • Loading branch information...
1 parent b622c8f commit 7caa53bd584f3b9551aedba95443f8b7d9c540d2 Matthias Bauer committed Nov 28, 2013
Showing with 11 additions and 3 deletions.
  1. +11 −3 README.rst
View
@@ -31,13 +31,21 @@ enable the ``HTML_MINIFY`` setting: ::
MIDDLEWARE_CLASSES = (
# other middleware classes
- 'htmlmin.middleware.MarkRequestMiddleware',
'htmlmin.middleware.HtmlMinifyMiddleware',
+ 'htmlmin.middleware.MarkRequestMiddleware',
)
Note that if you're using Django's caching middleware, ``MarkRequestMiddleware``
-should go after ``UpdateCacheMiddleware``, and ``HtmlMinifyMiddleware`` should
-go after ``FetchFromCacheMiddleware``.
+should go after ``FetchFromCacheMiddleware``, and ``HtmlMinifyMiddleware``
+should go after ``UpdateCacheMiddleware``: ::
+
+ MIDDLEWARE_CLASSES = (
+ 'django.middleware.cache.UpdateCacheMiddleware',
+ 'htmlmin.middleware.HtmlMinifyMiddleware',
+ # other middleware classes
+ 'django.middleware.cache.FetchFromCacheMiddleware',
+ 'htmlmin.middleware.MarkRequestMiddleware',
+ )
You can optionally specify the ``HTML_MINIFY`` setting::

0 comments on commit 7caa53b

Please sign in to comment.