Detailed description of php Cache Technology Principles and Examples (1/15)-PHP source code

Source: Internet
Author: User
Ec (2); Cache Technology: & nbsp; some information remains unchanged for example, but it can still be changed to cache to speed up display, this is very valuable. The so-called cache is commonly understood as sharing information stored on the server. it is generated on the same server. When saving the cache, we can specify the next update time. For example, we need to update it once every five minutes to record the last update time, compared with the current time, if it is more than 5 minutes, read the database tutorial and replace the update with, otherwise, script ec (2); script

Cache Technology:
Some information remains unchanged for example, but can still be stored in the cache to speed up the display speed. This is very valuable. The so-called cache is commonly understood as shared information stored on the server. it is generated on the same server. When saving the cache, we can specify the next update time. For example, we need to update it once every five minutes to record the last update time, compared with the current time, if it is more than 5 minutes, read the database tutorial and replace the update with; otherwise, the cache data is directly read. Of course, the cache needs to be activated by the client user only once.
Ob_start () function: Open the output buffer.
Function Format void ob_start (void)
Note: When the buffer zone is activated, all non-file header information from the php tutorial program is not sent, but stored in the internal buffer zone. To output the buffer content, you can use ob_end_flush () or flush () to output the buffer content.
Flush: refresh the buffer content and output it.
Function Format: flush ()
Note: This function is frequently used and highly efficient.
Ob_get_contents: returns the content of the internal buffer.
Function Format: string ob_get_contents (void)
Note: This function returns the content in the Current Buffer. If the output buffer is not activated, false is returned.
Ob_get_length: returns the length of the internal buffer.
Function Format: int ob_get_length (void)
Note: This function returns the length of the Current Buffer. It is the same as ob_get_contents. If the output buffer is not activated, false is returned.
Ob_end_clean: Delete the content of the internal buffer and disable the internal buffer.
Function Format: void ob_end_clean (void)
Note: This function will not output the content of the internal buffer but delete it.
Ob_end_flush: sends the content of the internal buffer to the browser and closes the output buffer.
Function Format: void ob_end_flush (void)
Description: This function sends the content of the output buffer (if any)
Ob_implicit_flush: Enables or disables absolute refresh.
Function Format: void ob_implicit_flush ([int flag])
Note: the buffer zone is disabled by default. After absolute output is enabled, the output of each script is directly sent to the browser, and you do not need to call flush ()
Ii. File writing:

Home 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 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.