This article will elaborate on the following aspects:
Text:
1. What is buffering
Buffering is a mechanism in the computer system that can temporarily store data. These data are then output to the user. The existence of buffering can make data processing more efficient, because buffering can avoid repeated calculations and reading data, improving the running speed of the program.
2. What is the PHP buffering mechanism?
The PHP buffering mechanism stores a certain amount of data in the memory when the program is executed, and does not output it temporarily. When the cache reaches a certain size or is When the program is executed, it is output to the client together. PHP can implement caching through functions such as ob_start(), ob_flush(), and ob_end_flush().
3. Why should you turn off the buffering
By default, the PHP buffering mechanism is turned on, but in some cases it is necessary to turn off the buffering.
4. How to turn off PHP buffering
There are many ways to turn off buffering in PHP programs.
Summary:
PHP buffering mechanism can improve the processing efficiency of the program, but in some special cases, buffering needs to be turned off. Developers can choose different ways to turn off caching based on actual needs. At the same time, after turning off the cache, you also need to pay attention to the memory consumption and output effects of the program to avoid unnecessary problems.
The above is the detailed content of What is buffering? Let's talk about php's buffering mechanism and closing method. For more information, please follow other related articles on the PHP Chinese website!