[OpenWrt-Devel] Fwd: [PATCH] uhttpd: serve precompressed files

Adrian Kotelba adrian.kotelba at gmail.com
Mon Sep 7 12:28:42 EDT 2015

2015-09-07 16:45 GMT+03:00 Bastian Bittorf <bittorf at bluebottle.com>:
> * Adrian Kotelba <adrian.kotelba at gmail.com> [07.09.2015 15:18]:
>> > ok, as far as i understand the patch, if somebody
>> > tries to http_get file 'xy.html' and the webserver
>> > finds 'xy.html.gz' it serves this file, right?
>> Right. More preciselly, if somebody tries to http_get file 'xy.html'
>> and the webserver does find it, then it serves it.
>> If 'xy.html' is not found, then webserver tries 'xy.html.gz'. If
>> 'xy.html.gz' is found, then it is served.
> ok, what you can do is this:
> check if HTTP_ACCEPT_ENCODING has some of
> gzip, deflate, sdch or whatever you think makes sense
> and live-compress if enabled via uci and it _is_ a
> static file. (i think the cgi-case is more complicated)
> also take care of the headers, you must set something like:
> 'Content-Encoding: gzip'
> unsure what to do with 'content length' because you
> only know this after compression, but you should do it
> chunkwise...
> bye, bastian

Thanks for hints. So, in other words, you propose to compress the
files on the fly, right?
I am afraid that low-end devices may not have enough cpu power to do that.

Furthermore, we may probably need to use zlib library. I will,
nevertheless, think about it.

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list