summaryrefslogtreecommitdiff
path: root/docs/ref/middleware.txt
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2012-02-03 20:45:45 +0000
committerAdrian Holovaty <adrian@holovaty.com>2012-02-03 20:45:45 +0000
commit6ecadcbdd2d2d34948e6482bfffe2c818887b39e (patch)
tree263e83715ed9ee02a989227166840b9b525d9202 /docs/ref/middleware.txt
parent00227b65296da44404b2b6c60a753142a967e46d (diff)
Made a bunch more edits up until [17418]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17428 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref/middleware.txt')
-rw-r--r--docs/ref/middleware.txt22
1 files changed, 13 insertions, 9 deletions
diff --git a/docs/ref/middleware.txt b/docs/ref/middleware.txt
index d57dbc9adc..99e2ae3838 100644
--- a/docs/ref/middleware.txt
+++ b/docs/ref/middleware.txt
@@ -96,17 +96,21 @@ browsers).
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.
-It will not compress content bodies less than 200 bytes long, when the
-``Content-Encoding`` header is already set, or when the browser does not send
-an ``Accept-Encoding`` header containing ``gzip``.
+It will NOT compress content if any of the following are true:
-Content will also not be compressed when the browser is Internet Explorer and
-the ``Content-Type`` header contains ``javascript`` or starts with anything
-other than ``text/``. This is done to overcome a bug present in early versions
-of Internet Explorer which caused decompression not to be performed on certain
-content types.
+* The content body is less than 200 bytes long.
-GZip compression can be applied to individual views using the
+* The response has already set the ``Content-Encoding`` header.
+
+* The request (the browser) hasn't sent an ``Accept-Encoding`` header
+ containing ``gzip``.
+
+* The request is from Internet Explorer and the ``Content-Type`` header
+ contains ``javascript`` or starts with anything other than ``text/``.
+ We do this to avoid a bug in early versions of IE that caused decompression
+ not to be performed on certain content types.
+
+You can apply GZip compression to individual views using the
:func:`~django.views.decorators.http.gzip_page()` decorator.
Conditional GET middleware