CF8 cfflush not working
|
|
Thread rating:  |
tslow - 05 Sep 2007 23:17 GMT I cannot get <cfflush> to work on a CF8 server. I am doing a simple cfoutput, running a cfx sleep tag, and then outputing more text with a cfoutput. On my CF6.1 server (which is identical besides the version of CF), this works correctly. On the CF8 server, nothing is displayed until the whole page finishes.
Both servers are running on Windows 2003 IIS 6. I'm returning a large chunk of text in both cfoutputs, so it's not the browser complaining that there is not enough text.
Thanks, Tim
tslow - 06 Sep 2007 21:27 GMT 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.
-Tim
<cfset VARIABLES.longText = '<p>' & RepeatString("a", 73722) & '</p>'>
<cfoutput>#VARIABLES.longText#</cfoutput> <cfflush> <cfset sleep(2000)> <cfoutput>#VARIABLES.longText#</cfoutput> <cfflush> <cfset sleep(2000)> <cfoutput>#VARIABLES.longText#</cfoutput> <cfflush>
<cfoutput>Length = #Len(VARIABLES.longText)#</cfoutput>
tomj - 07 Sep 2007 15:39 GMT 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.
tslow - 07 Sep 2007 16:24 GMT 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?
As for taking a different coding approach, we use AJAX a lot for things like this, but we have a specific backend need that cannot handle javascript. And pushing 73729 at a time seems a little ridiculous (but I guess possible).
Thanks, Tim
c_wigginton - 07 Sep 2007 14:47 GMT What browser and web server did you use for the test? IE as well as IIS buffer the content. 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), 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.
tslow - 11 Sep 2007 21:05 GMT 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?
pwenke - 14 Sep 2007 23:35 GMT 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.
Thanks, Pat
orangepips - 11 Dec 2007 19:33 GMT Seconding pwenke:
CF7 IIS6 works CF7 Apache2 works CF8 IIS6 fails CF8 Apache2 works
Adam Cameron - 11 Dec 2007 23:05 GMT > 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.
 Signature Adam
orangepips - 12 Dec 2007 14:47 GMT Here is my http://orangepips.instantspot.com/blog/index.cfm/2007/12/12/cfflush-Problem-and- Solution-on-CF8-with-IIS-
bear1 - 25 Oct 2007 22:04 GMT 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.
Thanks Chuck
mbiebrich - 13 Nov 2007 18:58 GMT 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.
CF8 Windows 2000 SQL Server 2000 (seperate machine) IIS 5
MrBlack - 08 Jun 2011 14:53 GMT CFFLUSH Work around.
I haven't tested in all environments but its working good so far. <cfoutput> #repeatString(" ", 250)# <!--- kick iis into doing something ---> </cfoutput>
OR
<cfscript> for(i=1;i LTE 250; i=i+1){ writeOutput(" "); // kick iis into doing something } </cfscript>
>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 [quoted text clipped - 12 lines] > SQL Server 2000 (seperate machine) > IIS 5 MrBlack - 08 Jun 2011 15:10 GMT >CFFLUSH Work around. (from ColdFusionJedi) > [quoted text clipped - 16 lines] >> SQL Server 2000 (seperate machine) >> IIS 5
|
|
|