question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC: Drop `compress` option?

See original GitHub issue

There is a standard way to disable compression support in fetch via Accept-Encoding header (works right now in node-fetch):

const res = await fetch("https://something.com/", {
  headers: { "Accept-Encoding": "identity" }
});

Do we really need a Node-only option here?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jimmywartingcommented, Jan 22, 2022

I can see a value in keeping this option… specially for those who wish to just proxy/forward a compressed response along. However. I think the name compress is slightly confusing. as the name applies that it should compress something while posting data.

it should be named something else…

  • it could be decompress: true.
  • or something closer to ‘Accept-Encoding’ and ‘Content-Encoding’ could be decode: true.
0reactions
tekwizcommented, Dec 25, 2020

I disagree that the compress option should be removed, but I do think it should be deprecated and renamed decompress since it controls decompressing the response rather than compressing the request.

Consider the scenario where the developer wants to implement their own decompression algorithm, maybe for coursework experimentation:

const res = await fetch("https://something.com/", {
  headers: {
    'Accept-Encoding': 'deflate'
  },
  compress: false
});

However, it does seem we should consider changing the behavior when setting compress: false to also set Accept-Encoding: identity. Consider this next example – the response body may or may not be compressed since no Accept-Encoding header is sent; however, this is likely not what the developer intended:

const res = await fetch("https://something.com/", {
  compress: false
});

They probably intended this:

const res = await fetch("https://something.com/", {
  headers: {
    'Accept-Encoding': 'identity'
  },
  compress: false
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC 2507: IP Header Compression
RFC 2507 IP Header Compression February 1999 octets. Header compression will decrease the header overhead for IPv6/TCP from 19.5 per cent to less...
Read more >
RFC 1144 - Compressing TCP/IP Headers for Low-Speed ...
Compressing TCP/IP Headers for Low-Speed Serial Links (RFC 1144, February 1990) ... a TCP option (the max. segment size) which the following packets...
Read more >
Setting RFC Bit Options in SM59 (SAP Library - SAP Help Portal
This option deactivates the compression of the function module tables. This means that tables are no longer compressed before they are sent, which...
Read more >
[RFC] Add option to limit llvm-profdata profile output size
Since it is hard to accurately compute the expected output size due to options like --compress-all-sections in extensible binary format, ...
Read more >
RFC 9204: QPACK: Field Compression for HTTP/3 - QUIC
This specification defines QPACK: a compression format for efficiently representing HTTP fields that is to be used in HTTP/3. This is a variation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found