Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix middleware and illustrate middleware order

  • Loading branch information...
commit 7caa53bd584f3b9551aedba95443f8b7d9c540d2 1 parent b622c8f
@moeffju moeffju authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 README.rst
View
14 README.rst
@@ -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::
Please sign in to comment.
Something went wrong with that request. Please try again.