On IIS cfm handler why there is no use of buffer ? the handlers are configured with responseBufferLimit="0". Is there any reason.
By @Eric318650369eow
Yes, I think there is at least one good reason for the configuration responseBufferLimit="0". By disabling response-buffering in the web server (IIS in this case), the setting ensures that output tags such as cfcontent (for streaming of file downloads) and cfflush will work as intended.
The web server is not the only response-bufferer. ColdFusion usually buffers output itself before sending it to IIS. That is to say, response-buffering is a shared responsibility between ColdFusion and IIS. Disabling response-buffering in IIS ensures that, by default, ColdFusion alone will have the responsibility of determining whether or not responses are buffered, and the maximum size of the buffer..
My guess is that ColdFusion is designed on the premise that the web server doesn't buffer responses. In other words, on the premise that responseBufferLimit="0" for the web server. This ensures that IIS sends output to the client immediately as it is received from ColdFusion. Otherwise, output tags such as cfcontent and cfflush will not work as intended.
However, depending on the requirements of your application, the setting responseBufferLimit="0" could be a serious issue. For example, if your application outputs responses in many small chunks. Especially, under high concurrency (multi-threading). Then, if ColdFusion's own response-buffering is insufficient, a lot of network overhead will be generated. That would usually result in high CPU usage.
But, even for such use cases, you can usually find a way out. You could, for example, implement solutions such as:
- Avoid or minimize response flushing;
- Avoid or minimize explicit response streaming;
- Wherever possible, aggregate (that is, buffer) many small chunks of output into a large response payload.