The only other thing I can think might be a factor is that I have switched off resource caching, which (from memory) may affect the Content-Length header.
On the subject of caching, I actually only needed to switch off the server-side caching of the CSS but had to switch off all caching as client side caching cannot be configured separately. The reason for this requirement is that the CSS includes paths to image resources which are dependant on the actionUrl in the session, and therefore the same CSS cannot be used across sessions.
I will do some more tests tomorrow.
Thank you Peter, for your feedback. We still cannot reproduce the delay, but able to reproduce the issue with wrong size. Most likely, it depends of the version a kind of servlet container.
The jira issue has been created:
So, in short, there is a incompatibility between DEFAULT loading style sheet strategy and default compression set that cause the unexpected delay on particular servlet containers.
The workaround is to have:
<context-param> <param-name>org.ajax4jsf.COMPRESS_STYLE</param-name> <param-value>false</param-value> </context-param
<context-param> <param-name>org.richfaces.LoadStyleStrategy</param-name> <param-value>ALL</param-value> </context-param>
You should turn on sniffer to see what HTTP headers are being sent.
As far as I remember with chunked encoding there should not be content-length and last chunk must be empty as indication for end of stream.
I think I have found the problem:
With enable-cache set to true the Content-Length appears to be correctly added to the response headers. This is the case with or without CSS compression. I think the headers may in this case be added by Tomcat.
With enable-cache set to false, the Content-Length is set based on the value calculated in either CountingOutputWriter or CSSCompressor (depending on whether CSS compression is enabled). Both of these classes multiply the number of characters by 2, to get the content length. This is incorrect. When I patch these classes to not multiply by 2, the content length is correct and I no longer get the 20 second delay.
Thanks , Solved same issue for me
Thank you very much, setting enable-cache to true also fixed the problem for me.
I had the same 20 sec slowdowns, and could verify that the Content-Length is twice as big as it should be, when not using enabled-cache.
I hope this issue will soon be fixed.