PHP common three kinds of cache technology _php Tutorial

Source: Internet
Author: User
I am the current PHP cache is divided into these four mechanisms, the first way, the need to load modules, may be charged for example Zend Company, may be free, but more discussion, the second way, such as in the mature large site with more appropriate; The third Way and the fourth four of the current PHP industry programs are more popular way

Divided into 3 categories

1. Cache module
This is done on the server cache settings, such as the Zend Company's cache products, etc., the main principle is through a compilation of PHP code files in memory, by reducing the operation of I/O to speed up access, not in the scope of this article
2.HTML mode
Perhaps you say that the way PHP generates HTML is not in the scope of this article discussed, but I personally for this way is still a cache way, such as the current popular generation of HTML programs are also many, such as some domestic CMS, this is not in the scope of this article, a stroke.
3. Generate the Cache file
This is for a number of commonly used and not constant changes in the volume, saved in the text, by reducing the amount of MySQL query to speed up the execution of the program, detailed content we then introduce
4.php caching mechanism
For example, the caching mechanism in the Smarty template, such as the current caching mechanism for the discuz! forum, is explained later in detail

To discuz! forum software version 5.0 (perhaps you said why take discuz! as an example, and not to phpwind or actually CMS for example, mainly because discuz! and I would like to say that the following two kinds of caching mechanism combined better, Other software products are more or less suitable for the requirements of this article, for example, in the third mechanism, discuz! the basic settings and common variables in a file under the Forumdata/cache folder, such as Cache_ Settings.php is that the data in the forum settings is stored in an array that always coexists in this file, using the include file when these variables are needed, and in the fourth mechanism, discuz! is the templates/ The template file in default, pre-compiled, that is, when requesting access to the index.php file, the program first in the Forumdata/templates whether the precompiled file has been generated, if it is included, if not in the template folder to find the template and then build, and then include , such a process

In this processing mechanism, in small load small site situation, obviously there will be a lot of waste, but in the large site or large-scale site of the specific implementation, performance, but obviously do the forum seems to be the load is relatively large, domestic water forum a bunch of Wow

Come to see Phpwind forum, as the only domestic PHP forum in the discuz! under the pressure is worth mentioning a forum system, obviously in the cache mechanism is not very good processing, PW before seems to be a text forum started, the same text for I/O pressure is very large, Especially on load balancing in large and medium-sized sites

Write here suddenly do not want to write, originally wanted to thank the plug-in development for the cache and template application, and then suddenly thought to write some of my personal understanding of the current PHP cache mechanism, wrote here, wrote 2 times, Dog Day server, Niang MySQL always lost Time out, you Niang, server with a bit of level and good, rely on , did not write the

http://www.bkjia.com/PHPjc/632238.html www.bkjia.com true http://www.bkjia.com/PHPjc/632238.html techarticle I am the current PHP cache into these four kinds of mechanisms, the first way, the need to load modules, may be charged for example, Zend Company, may be free, but more discussion, the second way, such as in ...

  • 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.