PHP Caching Technology Principles detailed description and examples (1/15)

Source: Internet
Author: User
Tags current time flush php tutorial

Caching technology:
Some information, such as the constant, but still variable information in the cache to speed up the display speed, this is very valuable, the so-called cache, popular understanding is a number of stored on the server side of the common information. It's on the server, and we can specify the time of the next update when we save the cache, For example, to update in 5 minutes, you can record the last update time, and the current time comparison, if more than 5 minutes, read the database tutorial, update replaced, otherwise directly read the cached data, of course, the cache needs the client user activation, only once.
Ob_start () function: Opens the output buffer.
function format void Ob_start (void)
Note: When the buffer is activated, all non-file header information from the PHP tutorial program is not sent, but is saved in the internal buffer. To output the contents of the buffer, you can use Ob_end_flush () or flush () to output the contents of the buffer.
Flush: Refreshes the contents of the buffer, output.
function format: Flush ()
Description: This function is frequently used and highly efficient.
Ob_get_contents: Returns the contents of the internal buffer.
function Format: string ob_get_contents (void)
Description: This function returns the contents of the current buffer and false if the output buffer is not active.
Ob_get_length: Returns the length of the internal buffer.
function format: int ob_get_length (void)
Description: This function returns the length of the current buffer, and, like ob_get_contents, returns False if the output buffer is not active.
Ob_end_clean: Deletes the contents of the internal buffer and closes the internal buffer
function format: void Ob_end_clean (void)
Description: This function does not output the contents of the internal buffer but deletes it
Ob_end_flush: Sends the contents of the internal buffer to the browser and closes the output buffer
function format: void Ob_end_flush (void)
Description: This function sends the contents of the output buffer (if any)
Ob_implicit_flush: Turn absolute refresh on or off
function format: void Ob_implicit_flush ([int flag])
Note: By default, the buffer is turned off, and when absolute output is turned on, each script output is sent directly to the browser and no longer needs to be invoked flush ()
Second, file writing:

Home 1 2 3 4 5 6 7 8 9 last

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.