ColdFusion - 如何设置Content-Length标头 [英] ColdFusion - how to set Content-Length header
问题描述
有没有人成功为常规ColdFusion(我使用的是CF9)页面添加了Content-Length标头?我正在思科负载均衡器后面设置一个带压缩的新服务器 - 盒子拒绝压缩任何没有这个头的东西,但CF默认不通过它。
Has anyone successfully added a Content-Length header to regular ColdFusion (I'm using CF9) pages? I'm setting up a new server behind a Cisco load balancer with compression - the box refuses to compress anything without this header, but CF doesn't pass it by default.
< cfheader name =Content-Lengthvalue =something>
将设置标题,但找到正确的值是个问题。
<cfheader name="Content-Length" value="something">
will set the header, but finding the right value is a problem.
任何指针都会非常感激。
Any pointers would be much appreciated.
推荐答案
我相信我已经解决了这个问题:
I believe I've solved it:
< cfheader name =Content-Lengthvalue =#getPageContext()。getCFOutput()。getBuffer()。size() #>
我坚持在o nRequestEnd()
和思科盒子很高兴压缩。
I stuck that in onRequestEnd()
and the Cisco box is happily compressing away.
感谢输入人员。
这篇关于ColdFusion - 如何设置Content-Length标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!