Massimo,

About gzipping.  It is not true that the webserver does the gzipping
at least not every combination of frontend/backend.

1) Rocket does gzipping?
2) Apache + wsgi does gzipping?
3) <server> + fcgi does gzipping?

What I know for sure is <server> + SCGI does gzipping:  I wrote it so
that uses wsgitools wsgi gzip application.
I also think UWSGI does the gzip.

The server usually gzips only static files.  Anyway I think that
gzipping can be implemented in python with little overhead since it
uses the underlying C implementation.

mic

2012/2/3 Massimo Di Pierro <massimo.dipie...@gmail.com>:
> OK, let's add a minifier in contrib.
>
> On Feb 2, 8:16 pm, Kernc <kernc...@gmail.com> wrote:
>> Sorry for late reply, didn't get any notification by email due to my
>> list preferences. It could send me a follow-up on the thread I
>> posted... Oh, well...
>>
>> Minification before gzipping still does make a difference:
>> this is my index.html:
>>
>> $ wc -c minified.html
>> 4827 minified.html
>> $ wc -c nonminified.html
>> 74910 nonminified.html
>> $ gzip minified.html && wc -c minified.html.gz
>> 2134 minified.html.gz
>> $ gzip nonminified.html && wc -c nonminified.html.gz
>> 8247 nonminified.html.gz
>>
>> Nearly 4-fold difference of minified&gzipped over non-
>> minified&gzipped. Not to mention minified HTML is faster and easier
>> for a browser to parse. And the minified-rendered views take up less
>> RAM when cache.ram'd (which is what one should do on nearly all
>> pages)....
>>
>> I would like the feature for its obfuscating nature. It hides the
>> implementation more, what is a loop, what is static html, how deep an
>> indentation goes...
>>
>> It must be worth something, Google does it 
>> (view-source:https://www.google.com/).
>>
>> The implementation quoted in comment #2 (http://code.google.com/p/
>> web2py/issues/detail?id=369#c2) solves the issue quite well for me. I
>> haven't found any new bugs. It even minifies inline JS. It works. :-)
>> I renounce all rights to this code, which likely "belong" more to the
>> original inventor of 
>> this:http://packages.python.org/web2py_utils/output.html#compress-output
>> (As far as I am concerned, you can just use it.)
>>
>> I agree a separate htmlminify module is an acceptable solution. :-)

Reply via email to