We've been having some difficulty with image-performance on one of our servers and have traced the problem to the Content-Length header returned by Zope as part of a 304 response. We're running Zope 2.5.1 through Apache 1.3.26 and pcgi. When a request is made to the server with an appropriate Is-Modified-Since header the code in lib/python/OFS/Image.py sets the Content-Length to the length of the image data but returns an empty string. My reading of the HTTP/1.1 spec suggests this is an error, see quote below: "If a Content-Length header field (section 14.13) is present, its decimal value in OCTETs represents both the entity-length and the transfer-length. The Content-Length header field MUST NOT be sent if these two lengths are different". So, we've patched our server by commenting out the line that sets the Content-Length and our problem goes away. Is this a bug in 2.5.1 or have I misunderstood something? I'm slightly concerned because this bit of code is commented as follows: # Set header values since apache caching will return Content-Length # of 0 in response if size is not set here I can confirm that this is true, but don't understand why this should be deemed a problem - no data is being returned. For those interested, our problem is that we have a firewall (well known brand I think) that seems to cause the connections to hang for a about 10s each time a 304 request for an image from one of our Zope servers passes through it. As a result, graphic pages are fast the first time you hit them (due to 200 responses) but deadly slow from then on! Before I go patching my other servers, I thought I'd post here in case it was a known problem and/or I've done something stupid. Steve
So this is simply a GET request with the If-Modified-Since header set correct? -Casey On Tuesday 27 August 2002 09:56 am, Steve Lay wrote:
We've been having some difficulty with image-performance on one of our servers and have traced the problem to the Content-Length header returned by Zope as part of a 304 response. We're running Zope 2.5.1 through Apache 1.3.26 and pcgi.
When a request is made to the server with an appropriate Is-Modified-Since header the code in lib/python/OFS/Image.py sets the Content-Length to the length of the image data but returns an empty string. My reading of the HTTP/1.1 spec suggests this is an error, see quote below:
"If a Content-Length header field (section 14.13) is present, its decimal value in OCTETs represents both the entity-length and the transfer-length. The Content-Length header field MUST NOT be sent if these two lengths are different".
So, we've patched our server by commenting out the line that sets the Content-Length and our problem goes away. Is this a bug in 2.5.1 or have I misunderstood something? I'm slightly concerned because this bit of code is commented as follows:
# Set header values since apache caching will return Content-Length # of 0 in response if size is not set here
I can confirm that this is true, but don't understand why this should be deemed a problem - no data is being returned.
For those interested, our problem is that we have a firewall (well known brand I think) that seems to cause the connections to hang for a about 10s each time a 304 request for an image from one of our Zope servers passes through it. As a result, graphic pages are fast the first time you hit them (due to 200 responses) but deadly slow from then on!
Before I go patching my other servers, I thought I'd post here in case it was a known problem and/or I've done something stupid.
Steve
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
At 10:40 -0400 2002-08-27, Casey Duncan wrote:
So this is simply a GET request with the If-Modified-Since header set correct?
Yep, sorry I didn't explicitly say that it was GET requests we're having trouble with but, yes, that's correct. Steve
Steve Lay wrote:
We've been having some difficulty with image-performance on one of our servers and have traced the problem to the Content-Length header returned by Zope as part of a 304 response. We're running Zope 2.5.1 through Apache 1.3.26 and pcgi.
When a request is made to the server with an appropriate Is-Modified-Since header the code in lib/python/OFS/Image.py sets the Content-Length to the length of the image data but returns an empty string. My reading of the HTTP/1.1 spec suggests this is an error, see quote below:
"If a Content-Length header field (section 14.13) is present, its decimal value in OCTETs represents both the entity-length and the transfer-length. The Content-Length header field MUST NOT be sent if these two lengths are different".
So, we've patched our server by commenting out the line that sets the Content-Length and our problem goes away. Is this a bug in 2.5.1 or have I misunderstood something? I'm slightly concerned because this bit of code is commented as follows: [...]
Steve
Steve, maybe you don't need to patch all zopes. I know it's not a clean solution, but you should be able to use apache to rewrite the offending headers. You should take a look at the header and rewrite directives, I'm quite sure that it's possible to fix up whatever zopes seems to be doing inappropriate for your firewall. cheers, oliver
Steve Lay writes:
... When a request is made to the server with an appropriate Is-Modified-Since header the code in lib/python/OFS/Image.py sets the Content-Length to the length of the image data but returns an empty string. My reading of the HTTP/1.1 spec suggests this is an error, see quote below:
"If a Content-Length header field (section 14.13) is present, its decimal value in OCTETs represents both the entity-length and the transfer-length. The Content-Length header field MUST NOT be sent if these two lengths are different". Looks like a Zope bug for me.
Please file a bug report to Zope issue tracker <http://collector.zope.org> Dieter
participants (4)
-
Casey Duncan -
Dieter Maurer -
Oliver Bleutgen -
Steve Lay