Re: [hackers] [quark][PATCH] Add support for precomputed compression

From: Laslo Hunhold <dev_AT_frign.de>
Date: Mon, 9 Mar 2020 08:30:23 +0100

On Sun, 8 Mar 2020 19:27:03 +0200
Guy Sviry <sviryguy_AT_gmail.com> wrote:

Dear Guy,

> If a client indicates that it supports gzip, then look for a `.gz`
> variation of requested file. If such gzipped file exists, send it
> instead and set the appropriate headers.

thanks for sending in this patch, however, I think that the approach
with gz-files is a bit half-boiled, for the reasons given below.
 
> Range requests and dirlist requests are not supported.

This is the reason why I think an online-approach would be more
suitable (i.e. compressing the stream on the fly during sending, which
would not discriminate against even range requests or dirlists).
Gzip is simple enough and modern servers can handle the load.

Even if we consider the "requirement" that we don't want mallocs
during serving, I think LZ77 is trivial enough to implement (with a
running dictionary and with a CRC to turn it into a DEFLATE-payload)
such that we can satisfy these constraints.

People might say: "Why not just link it against zlib?" But where's the
fun in that? ;)

With best regards

Laslo
Received on Mon Mar 09 2020 - 08:30:23 CET

This archive was generated by hypermail 2.3.0 : Mon Mar 09 2020 - 08:48:36 CET