11 Replies Latest reply on Dec 12, 2007 6:47 AM by orangepips

    CF8 cfflush not working

      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
        • 1. Re: CF8 cfflush not working
          tslow Level 1
          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.


          • 2. CF8 cfflush not working
            c_wigginton Level 1
            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
            http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/0b8f96a0-53ab-4 ef4-ab2e-7bfc5b6f426d.mspx?mfr=true

            • 3. Re: CF8 cfflush not working
              tomj Adobe Employee
              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.
              • 4. Re: CF8 cfflush not working
                tslow Level 1
                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
                • 5. Re: CF8 cfflush not working
                  tslow Level 1
                  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?
                  • 6. Re: CF8 cfflush not working
                    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.

                    • 7. Re: CF8 cfflush not working
                      bear1 Level 1
                      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.

                      • 8. Re: CF8 cfflush not working
                        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.

                        Windows 2000
                        SQL Server 2000 (seperate machine)
                        IIS 5
                        • 9. Re: CF8 cfflush not working
                          Seconding pwenke:

                          CF7 IIS6 works
                          CF7 Apache2 works
                          CF8 IIS6 fails
                          CF8 Apache2 works
                          • 10. Re: CF8 cfflush not working
                            Level 7
                            > 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.