Principle: Using Ob_flush () and flush () to output the contents of the buffer ahead of time, the browser can load this part of the content early, without waiting for all the output to complete and then load.
The content of the page is divided into small pieces, output one and then output the next, so that users can see the content of the page as soon as possible, optimize the user experience.
First the contents of the head should be loaded, load css,javascript and other static content as soon as possible, so you should use flush () output after head.
Example: First output head static content, then each <p> is divided into a chunk, every second output.
<!
DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >
The issues to be noted:
1. Try to use as much content as possible once output.
2. Try to load synchronously.
3.chunk is not the more the better, depends on the actual needs of the decision.
4.ob_flush () and flush () should be used at the same time, because in some cases flush () will have no effect.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/PHP/