Elliott has asked for the wisdom of the Perl Monks concerning the following question:

I have a system of Perl scripts that build web pages on the fly. I have never worried about content-size headers and this has never caused a problem on the shared server I use.

Now I am moving to a dedicated server and the pages hang. I have experimented by adding content-size headers and it works.

Both servers are Linux/Apache. Does anyone have any idea why it should work on one and not the other - and what I might change on the dedicated server to make it work there?

I suppose the "right" thing to do would be calculate content-size correctly - but that would involve changing and testing thousands of lines of code. The webhosts tell me that adding a large content-size value on every script (which would be much easier) will adversely affect my bandwidth accounting.

Replies are listed 'Best First'.
Re: Default Content-size
by cazz (Pilgrim) on Mar 29, 2005 at 16:24 UTC
    I'm guessing you mean Content-Length. If they are using Content-Length as a bandwidth counter, then don't bother putting Content-Length.

    Putting an invalid Content-Length is worse than not having a Content-Length. Some web clients trust that value. If it is too short, then some clients truncate the data to the specified length. If the value is too big, others will prompt the user that there was an error loading the page and stop. Many automated download tools are broken in the fact that they "do it right."
      >> I'm guessing you mean Content-Length.

      That could be why I couldn't find any results in supersearch! Doh.

      Meanwhile, further tests make me think this may not be the problem at all.

        And it turns out it wasn't the problem. All fixed now. Panic over. Stand easy, Monks.
Re: Default Content-size
by tlm (Prior) on Mar 29, 2005 at 18:44 UTC

    I never worry about Content-Length headers; CGI takes care of them. I take it you are not using CGI to generate your headers? (That'll lurn ya! :-) )

    the lowliest monk

      yeah.. there's a lot of things I'd do differently now six years on...

      TMTOWTDI but some of the WTDI work better than others.