Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does ob_start()/obflush() improve performance or add overhead? 1

Status
Not open for further replies.

awaresoft

Programmer
Feb 16, 2002
373
0
0
DE
PHP Newbie: Does ob_start()/obflush() improve performance or add overhead? Logically I would assume that ob_start() improves performance, but then wondered if that is the case then why isn't this the default behavior of PHP?

Thanks!
Malcolm
 
Use of the output buffering functions does increase overhead. The web server must store the entire buffered data in memory until the output is sent to the user.

But here's the comment from php.ini on the output_buffering runtime configuration directive:

[tt]; Output buffering allows you to send header lines (including cookies) even
; after you send body content, at the price of slowing PHP's output layer a
; bit. You can enable output buffering during runtime by calling the output
; buffering functions. You can also enable output buffering for all files by
; setting this directive to On. If you wish to limit the size of the buffer
; to a certain size - you can use a maximum number of bytes instead of 'On', as
; a value for this directive (e.g., output_buffering=4096).[/tt]

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Sleipnir214,

Excellent! Your comments have helped this newbie alot.

Thanks again!

Malcolm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top