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.

Threshold of `false` seems confusing

See original GitHub issue

Is threshold option being false means never compress no matter response size, or default threshold of 1 KiB, or something else?

// will compress any size
app.use(compression({threshold: 0}))

// returns JSON as plain text
app.use(compression({threshold: false}))

Makes sense to me that above two lines should be equivalent, but doesn’t seem to be the case. Should either change this, or add more detailed description into README.


❤️ to everyone working on this 😊

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
dougwilsoncommented, Jul 15, 2018

Hi @elmigranto sorry you were having trouble using the module. At first when I read your issue I was confused because I didn’t even know that false was a value allowed for the threshold option at all. I looked at it was indeed listed in the docs as a value, though when I checked in the tests there is no tests for such a value.

The implementation clearly does not support the value, as you observed.

I took a look back at the history of this project, various points in time of the implementation show that false has never been a supported value and looking at how it got added in the readme, it looks like a mistake that it got there at all.

I’m going to fix the readme for the time being.

I never thought about false being a possible value, but I think that makes sense I suppose. If you are interested in seeing false be a supported value, you’re welcome to make a pull request to support it, of course 👍

0reactions
elmigrantocommented, Jul 16, 2018

0 does the trick for me, so I think simply dropping that bit from the docs is just fine. Thanks, Doug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Discrimination threshold false positive & negative - Kaggle
The confusion matrix goes into a little more detail; this time it provides us with four values: The number of times our classifier...
Read more >
Demystifying ROC Curves. How to interpret and when to use…
The ROC curve shows a trade-off between TPR and FPR (or false negatives and false positives). It plots TPR vs FPR at different...
Read more >
A Gentle Introduction to Threshold-Moving for Imbalanced ...
Firstly, the true positive rate is called the Sensitivity. The inverse of the false-positive rate is called the Specificity.
Read more >
Manipulating class weights and decision threshold - Medium
It seems logical because y=0 entries have greater influence over the ... From the confusion matrix, the false negative and true positive ...
Read more >
Overcoming the effects of false positives and threshold bias in ...
False positives (FPs) have profound effects on graph theoretical (GT) analysis. ... However, the thresholds at which the group differences appear ...
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