Quantcast
Channel: BinaryTides » Coding
Viewing all articles
Browse latest Browse all 10

Output buffering in php and apache

$
0
0
Output Buffering
Output buffering is processing mechanism where the output being generated by a program is held in a place till its size reaches a limit or the generation is complete. Only after, will the output be send to its destination.
In php for example, doing and echo generates some output. Now this output might be buffered. If its not, then the output will appear on your browser as soon as it is generated. If it is buffered then the output of all echo statements is collected and shown to you once the php script has finished execution.
Output buffering is done for various reasons, like speeding up page load time, doing special processing to the generated content etc. However there are many cases when we want to see the output of the program in realtime as it is being generated. For example to monitor the progress of some task.
Buffering Points
In a php+apache setup, output buffering can happen at many places and finding it out can take some time. The execution is done somewhat like this
Browser <===> Apache <===> Php handler <===> Php interpreter/process
Php
Now the output can get buffered at any of the 4 places shown above. We shall ignore the browser for...

Read full post here
Output buffering in php and apache


Viewing all articles
Browse latest Browse all 10

Trending Articles