ColdFusion 2018 onRequestEnd CFOutput issue
When I try to get a page content by getPageContext().getCFOutput().getString() in onRequestEnd event, I get an empty string.
When I try to get a page content at the end of cfm script by the same code, I get what I expect: not empty content.
Application.cfc:
...
<cffunction name="onRequestEnd" output="false" returntype="void" >
<cfargument type="String" name="targetPage" required=true />
<cfdump var="getPageContext().getCFOutput().getString() in onRequestEnd: [#getPageContext().getCFOutput().getString()#]" output="C:\debug\debug_test_log.html" format="html" />
</cffunction>
...
test.cfm:
blah blah blah
<cfdump var="getPageContext().getCFOutput().getString() in test.cfm: [#getPageContext().getCFOutput().getString()#]" output="C:\debug\debug_test_log.html" format="html" />
The debug output (dumped into file) is following:
getPageContext().getCFOutput().getString() in test.cfm: [blah blah blah ]
getPageContext().getCFOutput().getString() in onRequestEnd: []
Any idea why it is empty in onRequestEnd event?
I remember it was working as expected in previous CF server versions and I was able to modify or cache an output before sending to a client.
