Skip to content

Commit 6bf7fce

Browse files
committed
Use GZipMiddleware for per-document page (result is 25% of original, and loads visibly faster)
- Legacy-Id: 1913
1 parent 2f3d6d8 commit 6bf7fce

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

ietf/idrfc/views_doc.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
from django.template import RequestContext
4343
from django.template.defaultfilters import truncatewords_html
4444
from ietf.idtracker.templatetags.ietf_filters import format_textarea, fill
45+
from django.utils.decorators import decorator_from_middleware
46+
from django.middleware.gzip import GZipMiddleware
4547

4648

4749
def document_debug(request, name):
@@ -92,6 +94,7 @@ def document_main_rfc(request, rfc_number):
9294
'history':history},
9395
context_instance=RequestContext(request));
9496

97+
@decorator_from_middleware(GZipMiddleware)
9598
def document_main(request, name):
9699
r = re.compile("^rfc([0-9]+)$")
97100
m = r.match(name)

0 commit comments

Comments
 (0)