compression icon indicating copy to clipboard operation
compression copied to clipboard

Flush alias

Open gigabo opened this issue 9 years ago • 3 comments

Hi,

This adds res.flushCompression() as an alias for res.flush()

This supports use such as:

// Not going to write again for a while.  If compression middleware is
// installed let's tell it to flush what we've got through to the client.
if (res.flushCompression) {
    res.flushCompression();
}

Currently the res object has a flush method regardless of whether compression middleware is installed. The built-in flush method issues a noisy deprecation warning. This patch provides an alias for the flush method to allow detection of the compression middleware's flush.

This addresses https://github.com/expressjs/compression/issues/72.

Thanks,

Bo

gigabo avatar Feb 17 '16 20:02 gigabo

This would help me as well - any feedback on this @dougwilson?

rexxars avatar Jun 26 '16 19:06 rexxars

This would be nice. Any chance of a quick review, @dougwilson?

wKovacs64 avatar Nov 08 '16 21:11 wKovacs64

In parallel, we can probably think of a good way to indicate if the response is getting compressed in a unique way that is obvious and doesn't conflict too much (darn Node.js taking res.flush() ;) ).

dougwilson avatar Nov 08 '16 21:11 dougwilson