Php ob cache

Source: Internet
Author: User
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.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.