CFFlush issues

Recently migrated from an old CF9 instance for an old app to Lucee 5.3.7.47.

Having an issue getting CFFlush to work. Page loads fully at end. Previous server runs code and flushes with no error.

Code being executed:

Starting...<br>
<cfloop from="1" to="100" index="a">
	<cfoutput><h1>#a#</h1></cfoutput>
	<cfflush interval="1">
	<cfscript>
		sleep(100);
	</cfscript>
</cfloop>

Server is Win Serv 2012 r2
IIS 8.5
Boncode connected
Apache Tomcat v9035
Lucee 5.3.7.47

Hi @Richx1,

What is the exact issue occuring with your code? Please provide more informations about the error, such as stacktrace etc

It’s not an error, per se. I believe this to be a configuration issue.

The code does not flush to screen in intervals. The code is not being displayed till the whole loop is completed.

Expected result is to see the code flush periodically to screen so that I will see the numbers increment on the screen as the page loads.

Example:
https://media.bodepro.com/news/test.cfm (old server, flushing correctly)

New Server:
https://service.bodepro.com/service/test2.cfm (new server, page loads all content at end)

-R

There are some pitfalls with cfflush. Do you have some sort of compression enabled at webserver level?

Please see also CFFLUSH not working

Compression is enabled on both servers (new and old). I removed compression on the new and restarted the site. Same issues. I checked the thread you linked also… nothing there to point me to why it is acting up. Tested the code on Lucee Express desktop version and it acted the same way. Leads me to wonder if this is a setting in the web server or tomcat?

I adjusted boncode settings and set FlushThreshold to 20000 as suggested elsewhere… still nothing. This is really becoming a challenge as I need cfscheduler to not timeout on long requests either. Flush was preventing that in CF9.

-R

Does it also happen if you request Tomcat directly on port 8888 (e.g. http://service.bodepro.com:8888/service/test2.cfm) from the local machine? What is strange is that your code behaves just the same at trycf with ACF.

My server admin locked down 8888 for this site on the server… local and remote.

Not sure I can test it there… but the local desktop express version I am running on 8888 on my desktop has the same issues.

-R

For flushing to work gzip compression needs to be turned off in both your web server and in Lucee (Lucee admin --> Settings --> Output --> Compression. This is probably okay in development but in production you probably want to have gzip compression enabled at some point in your stack.

Turned off compression in lucee server and web settings for output. Disabled compression for both dynamic and static content in IIS. Same issues.

-R

Not sure compression is the issue… seeing that with it on or off I am getting the same results.

-R

Rich, can you confirm whether you’re using a VPN or not? It’s one of the issues indicated in the first link on flush issues that Andreas had shared.

Not using a VPN. Both new and old machines are behind a NSA. New server is on a NAT, but the old machine is performing to spec. But to negate the NAT question, we tested on local host and the result is the same.

We moved the test file into Tomcat’s Root and tested there via 8888 (removing IIS from the mix) and we got the same result using only Tomcat/Lucee.

-R

Response headers on localhost:8888

|Response|HTTP/1.1 200 |
|Date|Thu, 05 Aug 2021 21:06:25 GMT|
|Content-Type|text/html;charset=UTF-8|
|connection|close|

Response Headers on public URL:
|Response|HTTP/1.1 200 OK|
|Cache-Control|private|
|Content-Type|text/html;charset=UTF-8|
|Server|Microsoft-IIS/8.5|
|X-AspNet-Version|4.0.30319|
|X-Powered-By|ASP.NET|
|Date|Thu, 05 Aug 2021 21:10:26 GMT|
|Connection|close|
|Content-Length|1209|

@Richx1
Have you enabled flushing in your BonCode settings. it is off by default.

If you used standard install you can add something like this to your setting file BonCodeAJP14.settings in C:\Windows
<FlushThresholdTicks>500000</FlushThresholdTicks>

Also check the flushing info in docs if you want to make changes:
http://www.boncode.net/connector/webdocs/Tomcat_Connector.htm

1 Like

WINNER!

I had been updating the flushThreashold in the settings file in C:\lucee\AJP13 instead of windows. After updating and restarting services… the result is on target.

@Bilal @carehart @justincarter @andreas - Thanks gents on all your help!

-R

2 Likes

Likewise! This helped me just now as well. Thanks all!

1 Like