Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#5313 closed (fixed)

GZipMiddleware should compress javascript

Reported by: mgiger@… Owned by: nobody
Component: HTTP handling Version: dev
Severity: Keywords: gzip javascript
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Only really old versions of Internet Explorer have problems with javascript compression anymore. Even Yahoo and Google compress their javascript now. Here is a simple one line patch to maintain compatibility with older versions of explorer while allowing gzip compression of javascript.

Attachments (3)

gzipdiff.diff (647 bytes ) - added by mgiger@… 17 years ago.
js_gzip.diff (671 bytes ) - added by jmelesky 17 years ago.
updated patch
js_gzip.2.diff (671 bytes ) - added by jmelesky 17 years ago.
against [6332]

Download all attachments as: .zip

Change History (9)

by mgiger@…, 17 years ago

Attachment: gzipdiff.diff added

comment:1 by Chris Beaven, 17 years ago

Triage Stage: UnreviewedDesign decision needed

comment:2 by Simon G. <dev@…>, 17 years ago

Triage Stage: Design decision neededReady for checkin

comment:3 by Fredrik Lundh <fredrik@…>, 17 years ago

I suggest changing

request.META.get('HTTP_USER_AGENT', '').find('MSIE') != -1

to

"MSIE" in request.META.get('HTTP_USER_AGENT', '')

by jmelesky, 17 years ago

Attachment: js_gzip.diff added

updated patch

by jmelesky, 17 years ago

Attachment: js_gzip.2.diff added

against [6332]

comment:4 by Simon Law <simon@…>, 17 years ago

You should note that "content-type" has to spelled in lowercase, if you're using request.get().

See #5772.

comment:5 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(In [6538]) Fixed #5313 -- Only avoid compressing Javascript when the user agent says it's Internet Explorer. Thanks, mgiger@….

comment:6 by Gary Wilson, 17 years ago

(In [6697]) Made some stylistic changes in GZipMiddleware and added some notes about IE, refs #5313.

Note: See TracTickets for help on using tickets.
Back to Top