The FacesBridge must follow the requirements in the JSF 2.2 JavaDoc. However, rather than call HttpServletResponse.setContentLength(int) the FacesBridge must call ResourceResponse.setContentLength(int). It is only valid to call this method during the RESOURCE_PHASE of the portlet lifecycle.
TCK compatibility for this method is satisfied by the following JSF Showcase use-case:
(Each image is served up from a ResourceHandler which sets the content length – the client receives a corresponding Content-Length header).