Change %Response.ContentLength
Hey everyone,
Might be a stupid question, but i was trying to set the ContentLength of the %response object in my website.
In different places (like the onPreHttp / onPostHttp etc) but none seems to work.
The reason behind it is to send a more accurate representation of the actual data I send, instead of having the overhead of the broker that adds more characters , I want the exact length of the response accounting only for the data that I actually returned.
Comments
see docs: https://docs.intersystems.com/ens201813/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25SYS&CLASSNAME=%25CSP.Response#ContentLength
• property ContentLength as %String;
Sets the Content-Length header. Since the HTTP headers are sent after the OnPreHTTP() method is complete, setting it after this has no effect.
Trying to set
Also part of the problem is that some responses has the response header "transfer-encoding: chunked"
which prevents having ContentLength anyway, but that is a different problem.
The %resposne.ContentLength doesnt change the actual value