Usage instructions for parsing PHP Cache functions _ php instances

Source: Internet
Author: User
This article provides a detailed analysis of the use of PHP Cache functions. For more information, see

Flush (): refresh the output program cache
For ($ I = 0; $ I <5; $ I ++ ){

Echo str_repeat ("\ n", 5000 );
Echo $ I;
Sleep (1 );
Flush ();
}

Ob_start (callback function, limited length, always output cache = 'true'): enabled, prerequisite: output_buffer = on
Ob_clear (): Refresh
Ob_end_clear (): Close and refresh
Ob_flush (): output
Ob_end_flush (): Close and output

Ob_get_contents: return cache
Ob_get_clean (): returns the cache and refreshes
Ob_get_flush (): returns the cache and closes
Ob_get_length (): return the length of the cached content.
Ob_get_level (): return the cache nesting level
Ob_get_status (return all = false): return the cache status

Ob_gzhandler (): compresses the output cache and serves as a callback function: ob_start ('OB _ gzhandler ')
Ob_implicit_flush (output refresh = true): when the parameter is true, the cache is automatically refreshed every time the cache output is cached.
Ob_list_handlers (): lists all functions that are using cache.


Output_add_rewrite_var (variable, value): add the value of the URL rewriter. this function adds a name/value pair to the URL rewriting mechanism. This type of name-value pair will be added to the URL (in the form of a GET parameter) and form (in the form of an input hidden field). when the URL is transparent

You can also add session IDs when session. use_trans_sid is enabled. Absolute URL (http://example.com/) is not overwritten, function behavior is controlled by the url_rewriter.tags php. ini parameter

Output_add_rewrite_var ('Var ', 'value ');
Echo 'rewriteable '; // after rewriting: link
Echo 'link2'; // The absolute address is not overwritten.
Echo ''; // after rewriting:

Output_reset_rewrite_vars (): resets the value of the URL Rewrite. true is returned successfully.

Output_add_rewrite_var ('Var ', 'value ');
Echo 'not overwritten ';
Output_reset_rewrite_vars (); // reset
Echo 'not overwritten '; // reset, address not overwritten

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.