Ticket #2113 (assigned task)

Opened 1 year ago

Last modified 1 month ago

[with patch and spkg, needs work] twisted.web2 should be gzip compressing things it sends out to the notebook

Reported by: jason Assigned to: jason (accepted)
Priority: major Milestone: sage-3.4
Component: notebook Keywords:
Cc:

Description

We ought to check to make sure that twisted has the gzip filter enabled and is sending things in zip encoding when it can.

Attachments

gzip.patch (3.7 kB) - added by jason on 10/18/2008 10:07:25 PM.

Change History

02/08/2008 11:15:21 AM changed by cwitty

This needs to be optional; for local notebooks (where the notebook and web browser are running on the same machine), this would very likely slow things down.

10/18/2008 10:07:25 PM changed by jason

  • attachment gzip.patch added.

10/18/2008 10:10:03 PM changed by jason

I posted a new twisted spkg that contains needed modifications to make this work here: http://sage.math.washington.edu/home/jason/twisted-8.1.0.p2.spkg

The above patch, combined with this new spkg, makes it so that pretty much all javascript, java, css, and a few other things are sent over the network compressed when the receiving host is not 'localhost' or '127.0.0.1'. It seems to cut the transfer down to about a third of what it was.

10/18/2008 10:10:29 PM changed by jason

  • summary changed from twisted.web2 should be gzip compressing things it sends out to the notebook to [with patch and spkg, needs review] twisted.web2 should be gzip compressing things it sends out to the notebook.

(follow-up: ↓ 5 ) 10/18/2008 10:11:15 PM changed by jason

I applied this patch on 3.1.4 after I applied the patch at #4267.

(in reply to: ↑ 4 ) 11/03/2008 12:53:57 AM changed by ddrake

The spkg and patch here apply fine on top of #4267 with 3.2.alpha2. How do you measure the actual bandwidth usage? The patch seems simple enough -- I'll presume that twisted really does gzip what it claims to -- but I want to see lower bandwidth usage. :)

11/27/2008 08:19:06 PM changed by jason

ddrake: use firebug in firefox. It will show exactly how much each page and include is taking, bandwidth-wise and speed-wise.

11/27/2008 08:31:59 PM changed by was

  • summary changed from [with patch and spkg, needs review] twisted.web2 should be gzip compressing things it sends out to the notebook to [with patch and spkg, needs work] twisted.web2 should be gzip compressing things it sends out to the notebook.

REFEREE REPORT:

I will give this a positive review when the following trivial things are all fixed.

1. The spkg has a file in there that it shouldn't have in the root directory:

teragon-2:twisted-8.1.0.p2 wstein$ pwd
/Users/wstein/Desktop/twisted-8.1.0.p2
teragon-2:twisted-8.1.0.p2 wstein$ hg status
? gzip.py.patch
teragon-2:twisted-8.1.0.p2 wstein$ ls
SPKG.txt	gzip.py.patch	patches		spkg-install	src

Just delete it and remake the spkg.

The spkg itself compiles fine.

That said, I'm confused as to what/where gzip.py.patch comes from. Evidently mhansen wrote it. It should probably be upstreamed?

2. There is a problem with SPKG.txt claiming mhansen did something, but actually Jason did:

20:26 < mhansen> How is this due to me?
20:26 < mhansen> I haven't seen this ticket before.
20:27 < jason--> the patch on the ticket just modifies twist.py
20:28 < ws-4636_2113> === twisted-8.1.0.p2 (Mike Hansen, October 18, 2008) === * Apply the patches to make the gzip filter deal 
                      with javascript mime types.
20:28 < ws-4636_2113> It's in SPKG.txt
20:28 < jason--> in the spkg that is on the ticket?
20:28 < ws-4636_2113> I think Jason Grout may have been impersonating you!
20:28 < mabshoff> And that is why we need SPKG.txt files
20:28 < jason--> is p1 from mhansen?
20:28 < jason--> (did I copy and not change something?)
20:28 < mabshoff> copy & paste?
20:28 < mhansen> I can't for the life of me remember doing that.
20:28 < ws-4636_2113> It's checked in by Jason.
20:29 < ws-4636_2113> So I think you didn't do it -- jason did.

3. The patch fails to apply, but almost applies:

was@sage:~/build/sage-3.2.1.alpha1$ ./sage
----------------------------------------------------------------------
| Sage Version 3.2.1.alpha1, Release Date: 2008-11-26                |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
hg_sage.applsage: hg_sage.apply('http://trac.sagemath.org/sage_trac/attachment/ticket/2113/gzip.patch')
Attempting to load remote file: http://trac.sagemath.org/sage_trac/attachment/ticket/2113/gzip.patch?format=raw
Loading: [.]
cd "/home/was/build/sage-3.2.1.alpha1/devel/sage" && hg status
cd "/home/was/build/sage-3.2.1.alpha1/devel/sage" && hg status
cd "/home/was/build/sage-3.2.1.alpha1/devel/sage" && hg import   "/home/was/.sage/temp/sage/9182/tmp_0.patch"
applying /home/was/.sage/temp/sage/9182/tmp_0.patch
patching file sage/server/notebook/twist.py
Hunk #10 FAILED at 1791
1 out of 11 hunks FAILED -- saving rejects to file sage/server/notebook/twist.py.rej
abort: patch failed to apply

Only one hunk fails, which doesn't really impact much how this works.

11/27/2008 08:35:32 PM changed by jason

  • owner changed from boothby to jason.
  • status changed from new to assigned.