Max Dynamic Response Header Size (bytes) ???

Discussion in 'Install/Configuration' started by ts77, Jul 13, 2005.

  1. ts77

    ts77 New Member

    I seem to have problems with sites which try to set a larger cookie.
    Would a dynamic response header which is too large be logged somewhere?
    The sites show only some part of the page while they show the whole page if I just remove the setcookie-call.
    Could it be that I just hit this limit?
    Would it be possible to allow larger numbers than 8K there so one could experiment with it?
  2. mistwang

    mistwang LiteSpeed Staff

    If the header is too large, you will get "WARN" log in your error.log, and send back 500 status code, so I believe the limit has not been reached.

    To debug this problem, you can try turning on the debug log and dumping the whole response header + body with tools like "lynx -mime_header ...".

    If you can provide a simple testing code, I can help debuging this problem.

    It is not possible to allow response header larger than 8K.
  3. ts77

    ts77 New Member

    I get only a "premature end of response headers" in the error-log nothing more.
    As I get only half of the page through lsws but running php-cgi (the same which is running the fcgi-backend with the same config) on the command-line with the same script I get the full page back, I can only guess that its related to lsws.
    I can try to manually generate such a long setcookie-call. Will come back to you tomorrow if I succeed.
  4. mistwang

    mistwang LiteSpeed Staff

    That error message means a FCGI protocol error, not the limit has been reached. It happens when PHP process crashed before sending the whole response header back to lsws, but you should not get half of the page if that is the case. Debug logging should be helpful.

    You can just hard code the cookie along with the html page in a php script.
  5. ts77

    ts77 New Member

    Hmm, seems like PHP just doesn't like to send that large cookies (~8-10K).
    Yes I know, I shouldn't send them but the app was failing on some laaaarge data this way.

    So, I think this problem is not related to litespeed, I could reproduce it on apache in the same way (and got absolutely no message there in the logs either).
  6. ts77

    ts77 New Member

    oh, on apache it seems to be no problem from php/apache-side but from the browser which doesn't show the page then ... probably doesn't like large headers either ;).
  7. mistwang

    mistwang LiteSpeed Staff

    ;-), see, not only lsws don't like cookies that big, browser won't eat it either.

    I think large cookies should be avoided by all means, it is not a good idea to store too many data in cookies. :)
  8. ts77

    ts77 New Member

    yep that changed in the new version of the software I use but until I can upgrade I have to live with the deficiencies in the old version ;).

Share This Page