Forum Moderators: coopster

Message Too Old, No Replies

php 4.3.10 outputs content-length headers!

hoorah.

         

mincklerstraat

9:07 am on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I only just yesterday figured out that php was issuing content-length headers, while doing some header debugging for a very unwily script.

Header debugging is something I do fairly regularly, so I'm fairly sure that I wasn't getting content-length headers with my old setup, which was PHP 4.3.8. One other thing has also changed: this is an Apache 2 setup, while the last was Apache 1; however I'd imagine the php change would be the main ingredient here.

Content-length headers are really not such a big deal. They are necessary for http pipelining, an advanced feature which you only get in advanced browsers like firefox if select it in about:config, and allows your browser to negotiate multiple requests simultaneously with the same server. Or something like that. I'd previously considered adding them manually to this and that, since I was already outputting some headers, but I don't believe I did. At any rate, don't bother any more, this gets done for you automatically now.

coopster

10:26 am on Jun 23, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I must admit I'm a bit perplexed here, minck. "Content-Length:" is quite common, particularly during a POST. Am I missing something?

mincklerstraat

10:33 am on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, it's common with POST, but not for normal php files or php_generated images -- e.g., check out the headers of phpbuilder.com (one of my favorites - they're still running 4.1.2, kinda ironic for a php site, eh?). My install is now churning out content-length headers for just about everything. Probably (or rather, definitely won't be able to) in the case that you use ob_implicit_flush(), since PHP won't have any way of predicting the content length.

coopster

11:07 am on Jun 23, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Ah. OK, I follow. I searched the PHP changelogs for any notes regarding this and came up empty. I found a few entries in the bug reporting system though.

[bugs.php.net...]
[bugs.php.net...]

mincklerstraat

2:09 pm on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey, thanks for the links! Btw, you know, it never occurred to me to try to search the changelog. There were times I got stuck with something that I thought might be version - bug specific, but figured looking through all the various changelogs would take forever. And whaddya know, the changelog for PHP 4, all subversions, is all on one easy-to-search page! (Yeah, this probably doesn't sound like such a revelation to most of you, but discovering this will sure make a big difference to me when I encounter similar such bugs). Thx for the tip coopster.