gzip apps by default

6 views
Skip to first unread message

Álvaro Justen [Turicas]

unread,
Apr 27, 2009, 2:09:18 AM4/27/09
to web...@googlegroups.com
Hello,
why aren't apps gzipped by default?
Ok, all source code is zipped, but if I want to download only one app
(from SVN/Bazaar or from appliances) I have to download a big file. An
example is examples.tar, that has 7,5MB - examples.tar.gz has only
810kB (less than 11% of the original size).

Some contries don't have super-high-speed Internet connections and I
prefer my proccess working on compression/uncompression than my
network with full load for a long time.

--
Álvaro Justen
Peta5 - Telecomunicações e Software Livre
21 3021-6001 / 9898-0141
http://www.peta5.com.br/

Yarko Tymciurak

unread,
Apr 27, 2009, 2:49:46 AM4/27/09
to web...@googlegroups.com

-rw-r--r-- 1 yarko web2py 7884800 2009-04-27 01:23 examples.tar
-rw-r--r-- 1 yarko web2py  579201 2009-04-27 01:34 examples.tar.7z
-rw-r--r-- 1 yarko web2py  798509 2009-04-27 01:27 examples.tar.gz
-rw-r--r-- 1 yarko web2py  798634 2009-04-27 01:25 examples.tar.zip

Why stop with gzip?  Why not use 7zip? ;-)

Actually, Python has gzip support - but not 7zip (yet).

AchipA

unread,
Apr 27, 2009, 9:27:12 AM4/27/09
to web2py Web Framework
I don't know how hard/easy it would be to convince cherrypy to gzip
content on the http level. It would actually make sense to have that
option for ALL text content, too, to minimize bandwidth use (this is a
web server level option, completely transparent to clients, and since
it relies on headers, it can automatically fall back).

On Apr 27, 8:09 am, Álvaro Justen [Turicas] <alvarojus...@gmail.com>
wrote:

mdipierro

unread,
Apr 27, 2009, 9:31:04 AM4/27/09
to web2py Web Framework
There are two issues here:

1) yes applications should be zipped. We can support both .tar
and .zip to avoid backward compatibility problems. Has been on my list
of things to do. Perhaps somebody will send me a patch.

2) data should (should?) be transmitted zipped by the web server.
cherrpypy's wsgiserver cannot do it but apache does it. It is not
clear that there is a real benefit since it takes time to zip/unzip.

Massimo

AchipA

unread,
Apr 27, 2009, 3:45:22 PM4/27/09
to web2py Web Framework
Text compresses very well, and usually much faster than the network IO
handles data. Example: let's say you have a 100KB/s link. If your main
page is 100KB, it takes a second to transfer it. Compressing 100K
takes WAY less than 1 sec and decompressing even less than that. Also,
in the time you're decompressing you can download the images in
parallel, effectively increasing overall browsing speed.

From the server aspect, CPU is usually cheap. Compressed pages means
connections can be ended sooner, which in turn lowers memory
requirements and improves response time.

So, unless your pages are really small or already compressed, it
almost always pays to compress. Not to mention bandwidth cost. The
exception is if this is an intranet or localhost deployment.

mdipierro

unread,
Apr 27, 2009, 5:40:58 PM4/27/09
to web2py Web Framework

Álvaro Justen [Turicas]

unread,
Apr 27, 2009, 5:54:26 PM4/27/09
to web...@googlegroups.com
On Mon, Apr 27, 2009 at 6:40 PM, mdipierro <mdip...@cs.depaul.edu> wrote:
>
> http://henry.precheur.org/2009/4/23/GZIP_encoding_%3D_happier_users%3F.html

Sending or not data via HTTP using gzip is one point.

Gzipping apps to distribute is another point.

I'm talking about the second point. Do you like this feature? Can I
code a patch?

mdipierro

unread,
Apr 27, 2009, 6:23:06 PM4/27/09
to web2py Web Framework
Sorry I misunderstood.
Please send me a patch. If possible move the code to "install",
"uninstall" and "pack" and "pack compiled" from admin to a new file
gluon/admin.py

Massimo

On Apr 27, 4:54 pm, Álvaro Justen [Turicas] <alvarojus...@gmail.com>
wrote:
> On Mon, Apr 27, 2009 at 6:40 PM, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> >http://henry.precheur.org/2009/4/23/GZIP_encoding_%3D_happier_users%3...

AchipA

unread,
Apr 28, 2009, 8:09:29 AM4/28/09
to web2py Web Framework
Yes, this conclusion is mostly in line with mine, but it's very
synthetic - in real life you'll see a larger boost (as you're not
downloading a single file).

Also, the encoding is I think most easily done through the mimetypes
module - it will recognize the extension and the compression so you
can open it with the proper module (e.g. tarfile, zipfile, etc) and it
will handle compression on it's own.

Álvaro Justen [Turicas]

unread,
May 7, 2009, 11:09:29 PM5/7/09
to web...@googlegroups.com
On Mon, Apr 27, 2009 at 7:23 PM, mdipierro <mdip...@cs.depaul.edu> wrote:
> Sorry I misunderstood.
> Please send me a patch. If possible move the code to "install",
> "uninstall" and "pack" and "pack compiled" from admin to a new file
> gluon/admin.py

Hi Massimo,
did you receive my last patch [today]?

mdipierro

unread,
May 8, 2009, 12:03:22 AM5/8/09
to web2py Web Framework
yes

On May 7, 10:09 pm, Álvaro Justen [Turicas] <alvarojus...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages