[PATCH] httpd: add option to send files using gzip content-encoding if available

Denys Vlasenko vda.linux at googlemail.com
Mon Jul 26 00:01:19 UTC 2010


On Sunday 25 July 2010 20:53, beebee at piments.com wrote:
> On 07/25/10 16:37, Peter Korsgaard wrote:
> > I'm not sure I'm getting you. Httpd never runs the find script I
> > mentioned above, the idea is that you can run it manually when you want
> > to update the cache - Not something that is done for each request.
> >
> >   beebee>  It just feels a  bit unfinished to expect the user to maintain gz
> >   beebee>  files manually on each update of the source file. He also has to be
> >   beebee>  made aware of how this feature works to insure he does that.
> 
> Sorry, I misunderstood your suggestion.
> 
> So you have to check whether there is a file with the same name but with 
> .gz on the end and hopefully check whether it is newer that the 
> requested file. If yes serve it else send requested without compression.
> 
> How many more bytes to run gzip if not the case?
> 
> Maybe I have not looked at this deeply enough but it seems trivial.

It boils down to this:

* Peter posted a patch which implements a feature
* You do not dispute usefulness of that feature, but feel that
  another feature, namely creating gzipped pages on demand,
  will be also useful
* No one says that your proposed feature is bad
* But you repeatedly state your opinion

This last point makes it look like you want someone to implement it,
but you do not want to say that in the open, fearing (rightly)
that the reply might be "why don't *you* implement it if you want it?"

Talking is usually easier than doing. Sad fact.

BTW, this can be implemented (expensively) by adding CGI wrappers
in httpd.conf around .htm[l] files:

*.html:/path/to/utility_which_creates_gzipped_pages
*.htm:/path/to/utility_which_creates_gzipped_pages

This setup has additional vfork+exec on every page (thus: expensive).
If utility_which_creates_gzipped_pages is written in C and built
statically, it may be not *that* bad wrt performance...

-- 
vda


More information about the busybox mailing list