Django

Code

Ticket #5313 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

GZipMiddleware should compress javascript

Reported by: mgiger@earthbrowser.com Assigned to: nobody
Milestone: Component: HTTP handling
Version: SVN Keywords: gzip javascript
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

gzipdiff.diff (0.6 kB) - added by mgiger@earthbrowser.com on 08/31/07 14:28:38.
js_gzip.diff (0.7 kB) - added by jmelesky on 09/15/07 16:09:52.
updated patch
js_gzip.2.diff (0.7 kB) - added by jmelesky on 09/15/07 16:25:18.
against [6332]

Change History

08/31/07 14:28:38 changed by mgiger@earthbrowser.com

  • attachment gzipdiff.diff added.

09/02/07 18:26:47 changed by SmileyChris

  • stage changed from Unreviewed to Design decision needed.

09/14/07 01:26:34 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Design decision needed to Ready for checkin.

09/14/07 09:50:43 changed by Fredrik Lundh <fredrik@pythonware.com>

I suggest changing

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

to

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

09/15/07 16:09:52 changed by jmelesky

  • attachment js_gzip.diff added.

updated patch

09/15/07 16:25:18 changed by jmelesky

  • attachment js_gzip.2.diff added.

against [6332]

10/19/07 09:35:34 changed by Simon Law <simon@akoha.org>

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

See #5772.

10/19/07 22:45:48 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

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

11/18/07 21:41:47 changed by gwilson

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


Add/Change #5313 (GZipMiddleware should compress javascript)




Change Properties
Action