Feedback needed: vmod_reqwest

Guillaume Quintard guillaume.quintard at gmail.com
Wed Jul 6 15:54:23 UTC 2022


On Wed, Jul 6, 2022 at 12:07 AM Dridi Boukelmoune <dridi at varni.sh> wrote:

> I didn't find how to scam people with NFTs in the manual, should I
> open a github issue?
>

No no no, it's just to weed out the weak investors, send me 5 bitcoins and
I'll show where it is.


>
> In general, I agree, the API looks rather well thought out, even
> though it does suffer bloated constructor syndrome.


Yes, I realized later that I could use the event method of the backend to
finalize the object, however, I'm not sure this:

new client = reqwest.client();
client.set_base_url("http://www.example.com");
client.set_follow(5);
client.set_brotli(true);
client.set_probe(p1);
client.set_connect_timeout(5s);


is more readable, or practical than:

new client = reqwest.client(
base_url = "http://www.example.com",
follow = 5,
auto_brotli = true,
probe = p1,
connect_timeout = 5s
);


(consider this a question to you all, if you have an opinion, voice it!)

Did you put only
> timeout and connect_timeout to lower the number of arguments or
> weren't you able to implement ftbo and bbto with reqwest? I suspect
> both :p
>

Definitely the latter, once you pass the 6-7 arguments threshod, the sky's
the limit.


>
> Also it says this:
>
> > In practice, when contacting a backend, you will need to `unset
> bereq.http.accept-encoding;`, as Varnish sets it automatically.
>
> Probably a nice spot to mention
>
> https://varnish-cache.org/docs/7.0/reference/varnishd.html#http-gzip-support
> to explain why one would be set.
>
> On the other hand, if you disable gzip support you may also be
> forwarding the client's accept-encoding header if it survived all the
> way to the backend fetch
>

Good points, I can update the docs. I'm wondering though if it's better to
special-case the AE header handling in the vmod and try to be smart, or
just let the user do it in VCL...

-- 
Guillaume Quintard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20220706/82af0ebe/attachment.html>


More information about the varnish-misc mailing list