This content has been marked as final. Show 11 replies
I did a little more research and it seems that it CF8 only flushes when there is a lot of text to push. Specifically, it needs 73729 characters before it will push any data. This seems to be the same size that <cfflush interval=1> uses. Is there a way to lower this number? Or is this due to a setting on my server? We don't use <cfflush> very often, but when we do, we want the browser to know that we are still processing a page and that it shouldn't timeout.
Here's what I used to test this. On my server, if you lower the size of the outputted text by one character, it doesn't flush for the first cfflush.
What browser and web server did you use for the test? IIS buffers the content by default and IE seems to buffer (or is it cache related) as well. I just tested your code on CF8 in a multiserver configuration with an IIS web server connector. Both Firefox and IE experienced the same buffering in that configuration.
I further tested the file using the built-in web server of CF. With IE, the buffering occurred (IE buffering/cache), but when I used FireFox with the CF built-in web server, no buffering and flushing worked as expected, multiple refreshes as well and still no cfflush problems with the built-in CF web server and Firefox.
You might want to consider looking into a UI re-design for providing the user status on a long process by delivering a quick layout and then through periodic polling, grab an updated status of the process via AJAX.
IIS (6) Buffering
To be clear, ColdFusion flushes its output buffer immediately when cfflush is called.
As pointed out in other postings, there is a lot of software (J2EE server, web server, network and client) between ColdFusion and the browser, so if you are seeing delays, there are many places to look. My guess is the web server, as we know JRun and Firefox do not interfere with cfflush.
The reason why I think that this is a CF 8 specific issue is that I have a development machine running two virtual machines. They both are identical in (almost) every way as one was cloned from the other. They both have Windows 2003, IIS 6, some DCOMs, and some asp code. The only difference is that one is running CF6.1 and the other is running CF8.
I can run the code I posted (using cfx_sleep instead of sleep()) on both the CF6 and CF8 machines. The CF6 machine flushes correctly -- I can lower it to output only one character at a time and it flushes every time. With CF8, it appears that this requires a minimum of 73729 characters for the buffer to flush.
I can look more into IIS, but I don't think that will give me anything because these two machines are identical besides the coldfusion installs. Does this work with CF8 running on JRun? Perhaps there is something weird with the way that CF8 interfaces with IIS?
I've searched through all of the settings files that I could find for IIS and CF8 and couldn't find anything that seemed related to this issue. The buffering that c_wigginton suggested seems to only apply to asp (I tried it and it doesn't work).
Do other configurations flush pages back to Firefox immediately upon <cfflush> tag call? I'm only able to test CF8 Standard as the Server configuration on top of IIS6. It would be nice to know if the problem does lie somewhere with my server's settings, although I've run out of things to try. Should I submit a bug to Adobe?
Has anyone found a solution to this problem? Turning buffering off in IIS does not work.
I have the following configurations, some where <cfflush> works and some where it does not:
CF7 on IIS6 - works
CF8 on IIS6 - does not work
CF8 on IIS7 - does not work
CF8 on Apache2 - works
The box I have with CF8 on IIS6 was just upgraded from CF7 to CF8. No code changes, no IIS changes, only CF. It worked before; it's broken now.
On a side note, <cfflush> does not work with some configurations of IIS compression.
I have the same problem. Installed CF 8 on a Windows 2003 server running IIS and the cfflush tag no longer works. On an identical (as far as I know) server running cf 7, it works fine.
If I provide a comment with the number of characters specified by tslow above then it works. I also have this same problem on a cf8 development installation running on Vista.
We just recently upgraded one of our development servers from CF7 to CF8 and code within our CMS that used CFFlush before and worked just fine no longer works correctly in CF8.
The entire process runs without error, CF just doesn't appear to be flushing the content out to the browser. The same code works properly on our CF7 dev box, and both our CF6 and CF7 production boxes. Same results in FF and IE.
Just some extra info in case it helps, this is the box that it worked on just fine before we upgraded. The code is really simple, no tables, nothing out of the oridinary.
SQL Server 2000 (seperate machine)
CF7 IIS6 works
CF7 Apache2 works
CF8 IIS6 fails
CF8 Apache2 works
> CF8 IIS6 fails
On this CF instance, browse to the template using the in-built JRun
webserver instead of IIS. Does the flushing (!) work? This is a fair
low-impact reconfiguration (if any at all), and quickly will demonstrate
whether it's IIS or CF at fault.
To throw the cat amongst the pigeons, I've also see flushing not work on
one CF7 machine where another with "identical" set-up (same CF, OS, web
server config, set up by the same person, at the same time) and code works
fine. Unfortunately the one that works fine is our QA server. The one not
working is the client's live server :-(
That said, I've never thought it to be a CF problem, I've always assumed
it's some sort of caching or transmission hold up from the web server, or
intermediary network equipment.