what is the header to stop buffering?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • laredotornado@zipmail.com

    what is the header to stop buffering?

    Hi,

    I'm using PHP 4.4.4. What is the header I need to send in order for
    output to be continuously sent to the client browser as opposed to it
    being buffered and all sent at once?

    Thanks, - Dave

  • Pedro Graca

    #2
    Re: what is the header to stop buffering?

    laredotornado@z ipmail.com wrote:
    I'm using PHP 4.4.4. What is the header I need to send in order for
    output to be continuously sent to the client browser as opposed to it
    being buffered and all sent at once?
    Disable output buffering in php.ini

    output_bufferin g = Off

    but it will not work!

    PHP will spew out characters as fast as it has them, then Apache (or
    whatever your webserver is) will get hold of them and buffer them :)
    So you need to stop Apache (or ...) from buffering (I don't know how to
    do that ... you might want to ask in an appropriate newsgroup). If you
    manage that, then you'll have proxies, firewalls, routers, ..., between
    the webserver and the client browser. They all /may/ add buffering on
    their own. Even if they don't, the client browser /may/ buffer the
    incoming data before displaying it.

    So ... don't worry about it!

    --
    I (almost) never check the dodgeit address.
    If you *really* need to mail me, use the address in the Reply-To
    header with a message in *plain* *text* *without* *attachments*.

    Comment

    • Jerry Stuckle

      #3
      Re: what is the header to stop buffering?

      laredotornado@z ipmail.com wrote:
      Hi,
      >
      I'm using PHP 4.4.4. What is the header I need to send in order for
      output to be continuously sent to the client browser as opposed to it
      being buffered and all sent at once?
      >
      Thanks, - Dave
      >
      Dave,

      There aren't any headers you can send. However, you can cause the data
      to be sent to the browser immediately with:

      ob_flush();
      flush();

      This will cause PHP to flush the output immediately, and generally
      Apache will do the same. Whether or not it will be displayed
      immediately, however, is up to the browser.

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • DaveO

        #4
        Re: what is the header to stop buffering?

        I had a similar problem that the flush commands did not resolve.

        Called my hosting ISP - techie there found that something called "mod_gzip"
        was 'on' - turned it 'off' and problem solved.

        Hope it helps

        Regards
        Dave


        <laredotornado@ zipmail.comwrot e in message
        news:1162053689 .869188.141340@ m7g2000cwm.goog legroups.com...
        Hi,

        I'm using PHP 4.4.4. What is the header I need to send in order for
        output to be continuously sent to the client browser as opposed to it
        being buffered and all sent at once?

        Thanks, - Dave




        Comment

        • Petr Vileta

          #5
          Re: what is the header to stop buffering?

          "Jerry Stuckle" <jstucklex@attg lobal.netpíse v diskusním príspevku
          news:AdydnSBDea byg9nYnZ2dnUVZ_ oWdnZ2d@comcast .com...
          laredotornado@z ipmail.com wrote:
          >Hi,
          >>
          >I'm using PHP 4.4.4. What is the header I need to send in order for
          >output to be continuously sent to the client browser as opposed to it
          >being buffered and all sent at once?
          >>
          >Thanks, - Dave
          >>
          >
          Dave,
          >
          There aren't any headers you can send. However, you can cause the data to
          be sent to the browser immediately with:
          >
          ob_flush();
          flush();
          >
          This will cause PHP to flush the output immediately, and generally Apache
          will do the same. Whether or not it will be displayed immediately,
          however, is up to the browser.
          >
          And a little trick for browser is to send 1024 or more spaces anywhere where
          it is possible in html content.
          Example:

          <p>some text which should be unbuffered</p>
          ......1024 spaces here...
          <?php ob_flush(); flush(); ?>
          <p>another text</p>

          --

          Petr Vileta, Czech republic
          (My server rejects all messages from Yahoo and Hotmail. Send me your mail
          from another non-spammer site please.)



          Comment

          • Jerry Stuckle

            #6
            Re: what is the header to stop buffering?

            Petr Vileta wrote:
            "Jerry Stuckle" <jstucklex@attg lobal.netpíse v diskusním príspevku
            news:AdydnSBDea byg9nYnZ2dnUVZ_ oWdnZ2d@comcast .com...
            >
            >laredotornado@z ipmail.com wrote:
            >>
            >>Hi,
            >>>
            >>I'm using PHP 4.4.4. What is the header I need to send in order for
            >>output to be continuously sent to the client browser as opposed to it
            >>being buffered and all sent at once?
            >>>
            >>Thanks, - Dave
            >>>
            >>
            >Dave,
            >>
            >There aren't any headers you can send. However, you can cause the
            >data to be sent to the browser immediately with:
            >>
            > ob_flush();
            > flush();
            >>
            >This will cause PHP to flush the output immediately, and generally
            >Apache will do the same. Whether or not it will be displayed
            >immediately, however, is up to the browser.
            >>
            And a little trick for browser is to send 1024 or more spaces anywhere
            where it is possible in html content.
            Example:
            >
            <p>some text which should be unbuffered</p>
            .....1024 spaces here...
            <?php ob_flush(); flush(); ?>
            <p>another text</p>
            >
            That depends on the buffer size. 1024 may be large enough - or it may not.

            Plus it raises your bandwidth 1K every time you do it - not to mention
            the extra download time the client requires, especially if it's a
            dial-up connection.

            Not a real good idea, actually.

            --
            =============== ===
            Remove the "x" from my email address
            Jerry Stuckle
            JDS Computer Training Corp.
            jstucklex@attgl obal.net
            =============== ===

            Comment

            Working...