CFFLUSH not working

CF Flush is working on the express version.

However when I put it on a server it does not work. Just waits and loads the whole page. I am not using whitespace management or compression (gzip).

Anyone have any ideas?

General Info
Version	Lucee 5.2.3.35
Version Name	Velvet
Release date	Sep 1, 2017
ColdFusion® compatibility version	2016.0.03.300357
Configuration File	/opt/lucee/tomcat/lucee-server/context/lucee-server.xml
OS	Linux (4.9.43-17.39.amzn1.x86_64) 64bit
Servlet Container	Apache Tomcat/8.5.16
Java	1.8.0_144 (Oracle Corporation) 64bit
Architecture	64bit

Express doesn’t use a webserver like apache/nginx, so it’s probably something to do
with your webserver config, do you have gzip enabled?

ya so im not sure is that a setting in lucee or tomcat? i guess what i need help with is what is the right config settings for tomcat to allow for cfflush. thanks for the help. really appreciate it.

1 Like

I don’t think it’s tomcat, like i said, i think it it’s something with your webserver config?

What webserver are you using?

running aws linux. used this guide to set up. http://www.augustkleimo.com/install-lucee-on-an-aws-linux-ec2-instance/

apache

in dev tools, what does the content-encoding header say for the page which won’t flush?

Content-Encoding:gzip?

GET /reports/test.cfm HTTP/1.1
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8,fr;q=0.6
Cookie: cfid=8dc98f59-31e4-4f8d-8d34-4ab208894aaa; cftoken=0; CFID=8dc98f59-31e4-4f8d-8d34-4ab208894aaa; CFTOKEN=0
Name
test.cfm

Response headers are

HTTP/1.1 200
Set-Cookie: CFID=8dc98f59-31e4-4f8d-8d34-4ab208894aaa;Path=/
Set-Cookie: CFTOKEN=0;Path=/
connection: close
Content-Type: text/html;charset=UTF-8
Date: Tue, 10 Oct 2017 16:55:16 GMT

Got it working by using Nginx instead of Apache and adding this to the header. Nginx is smart enough to let the flush work when it sees the header.

cfheader name="X-Accel-Buffering" value="no"

thanks tor getting me thinking in the right direction.

so I just tried this on a pretty vanilla install from the installer on win10, updated to
Lucee 5.2.5.19-SNAPSHOT, on win10 with Apache Tomcat/8.5.16 and Apache/2.4.27
and it works fine

<cfloop from="1" to="10" index="a">
	<cfoutput><h1>#a#</h1></cfoutput>
	<cfflush>
	<cfscript>
		sleep(1000);
	</cfscript>
</cfloop>

i also just filed https://luceeserver.atlassian.net/browse/LDEV-1545

Have the same issue but CFFLUSH isn’t working.

I do see GZIP in the resultant header.

Instead of flushing, the code comes through after 10 seconds:—

<!doctype html>
<html>
  <body>
  <h2>Starting!...</h2><cfflush>
  <cfoutput>
  <cfset cycle=1>
  <cfloop condition="cycle lte 100">
   <cfset sleep(100)>
   <cfset cycle=cycle+1>
   .<cfflush>
  </cfloop>
  </cfoutput>
</body>
</html>

Vanilla Lucee install on top of VirtualMin on a fresh Ubuntu EC2 instance.

UPDATE: It was working, but not behind a VPN.

Are you using Apache or nginx?

As there are a couple of caching mechanisms all baked into apache that maybe causing the issue

1 Like

Thanks, Terry_Whitney! It was working but for some reason my VPN was interfering and making it look like it flushing wasn’t working.

1 Like