How to use Ob_flush () and flush () for PHP
Note: the Ob_flush () and flush () functions are generally used together, in order to Ob_flush () first, then flush (), and their function is to flush the buffer.Here's a specific next time to use the
mysql performance optimization · Discussion on the flush strategy of InnoDB buffer poolBackgroundWe know that InnoDB uses buffer pool to cache data pages that are read from disk to memory. Buffer pool is usually composed of a number of memory blocks
Ec (2); let's look at a piece of code first. & Lt ;? Phpfor ($ i10; $ I & gt; 0; $ I --) {& nbsp; echo $ I; & nbsp; flush (); & nbsp; sleep (1 );}? & Gt; according to the statement in the php manual & nbsp; this function sends all the output of the
For ($ I = 10; $ I> 0; $ I --){Echo $ I;Flush ();Sleep (1 );}?>
According to the PHP Manual
This function sends all the output of the program so far to the user's browser.
The above code should output $ I every second. But not necessarily in
For ($ I = 10; $ I> 0; $ I --){Echo $ I;Flush ();Sleep (1 );}?>According to the PHP ManualThis function will be available until now Program All the output is sent to the user's browser.The above section Code , $ I should be output every second. But
For ($ I = 10; $ I> 0; $ I --){Echo $ I;Flush ();Sleep (1 );}?>According to the php ManualThis function sends all the output of the program so far to the user's browser.The above code should output $ I every second. But not necessarily in reality.
How to use Ob_flush () and flush () for PHP
Note: the Ob_flush () and flush () functions are generally used together, in order to Ob_flush () first, then flush (), and their function is to flush the buffer.Here's a specific next time to use the
As you know, there is a layer in PHP called the output buffer. This article is to explain what it really is? How does PHP internally implement it? And how do I use it in a PHP program? This layer is not complex, but it is often misunderstood, and
InnoDB maintains a cache of data and index information to the memory of the storage area called buffer pool, which caches the most recently accessed data. By configuring the parameters of each buffer pool, we can significantly improve the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.