PHP buffer ob_flush() vs. flush() -
what's difference between ob_flush()
, flush()
, why must call both?
the ob_flush()
reference says:
this function send contents of output buffer (if any).
the flush()
reference says:
flushes write buffers of php , whatever backend php using (cgi, web server, etc).
however, continues say:
[it] may not able override buffering scheme of web server…
so, seems me use ob_flush()
of time. however, strange results when that. explain in simple terms what's going on here?
ob_flush
sends application-initiated buffer. there may multiple nested ob_start()
's in php script. ob_flush
passes current content upper layer.
php might (at own discretion) buffer output. depends on back-end. fastcgi
has socket buffer on own. therefore flush()
needs invoked send current content web server.
and web server might implement buffering scheme (mod_deflate
or content filter), have no influence over. seldom, needs configured specifically.
anyway, use both.
Comments
Post a Comment