Skip to main content

flushHeaders

method OutgoingMessage.prototype.flushHeaders
Jump to headingOutgoingMessage.prototype.flushHeaders(): void

Flushes the message headers.

For efficiency reason, Node.js normally buffers the message headers until outgoingMessage.end() is called or the first chunk of message data is written. It then tries to pack the headers and data into a single TCP packet.

It is usually desired (it saves a TCP round-trip), but not when the first data is not sent until possibly much later. outgoingMessage.flushHeaders() bypasses the optimization and kickstarts the message.

Return Type Jump to heading

void
Back to top