Php ob cache (1) ob cache response process
If the ob cache is enabled, the echo data is first stored in the ob cache. For header information, it is directly stored in the program cache. After the page is executed, the ob cached data is put into the program cache and then returned to the browser in turn.
(3) How to enable ob cache
1. add output_buffering = 4096 to the php. ini file in the configuration file.
Note:After php5.3, the ob cache is enabled by default.
2. add an ob_start () in the program; // enable ob cache
(4) several important ob functions:
Ob_get_contents (); // get ob cache data
Ob_clean (); // clear the data cached by ob
Ob_end_clean (); // clear the data cached by ob and disable the cache.
Ob_flush (); // refresh (cut) the ob cached data to the program cache
Ob_end_flush (); // refresh (cut) the ob cached data to the program cache and disable the ob cache.