如何清除ColdFusion中的响应缓冲区?

Lar*_*nal 6 coldfusion

我正在寻找类似的东西Response.Clear().

Edw*_*ith 25

您可以使用带有reset参数的cfcontent标记重置输出缓冲区:

<cfcontent reset="true">
Run Code Online (Sandbox Code Playgroud)

  • 这与`<cfset GetPageContext().getCFOutput().clear()>`具有相同的功能,但它被记录,支持,并且正如Edward在他对jfrobishow的答案的评论中指出的那样,可以在CFML引擎之间移植.这是要走的路. (2认同)

jfr*_*how 11

这将清除响应主体并阻止缓冲内容的输出 -

<cfset GetPageContext().getCFOutput().clear()>
Run Code Online (Sandbox Code Playgroud)