PHP Caching Technology _php Tutorial

Source: Internet
Author: User
Tags php compiler php template
The way Web programs get information is primarily querying the database, which is not a big problem when the database is not very large. However, with the development of the website, the database in a geometric pattern of growth, there will be bottlenecks. So the PHP cache technology was born. PHP cache includes both PHP compilation cache and PHP data cache.

PHP is an interpreted language, which belongs to the side-compilation side of the run. The advantage of this mode of operation is that program modification is convenient, but the operation efficiency is very low. PHP compiler cache for this situation to improve processing, so that the PHP language only run once, you can put the program's compilation results cached. This way, the next run does not need to be compiled again, which greatly improves the speed of PHP operation.
PHP data caching is used in the actual development of PHP for data processing caching, the main two directions are: Database data cache and for PHP template data cache.

PHP compiled cache: The most common PHP compiler caching tools are: Apc,accelerator,xcache (domestic) and so on.

PHP is an interpreted language that requires the following two steps when executing code in the PHP language:

1, the compilation process. PHP reads the file, compiles the file, and then generates an intermediate code that can be executed on the Zend engine virtual machine.

2, the implementation process. PHP executes the intermediate code directly.

The following two scenarios cause PHP to run program code inefficiently:

1, even if the PHP code file does not change, it will be recompiled by PHP.

2, if there is a reference file, PHP will also take the time to recompile these referenced files. Therefore, the PHP compilation cache tool is required to cache the compiled results of the PHP program. This way, the PHP program only compiles once, do not re-make meaningless compilation.

PHP data cache: PHP's data cache includes caching for database data and caching for PHP template data. The tools for caching database data are memcache and so on. The main tools for caching PHP template data are smarty and so on.

Articles you may be interested in

    • PHP Cache Operation Example Detailed
    • Smarty Cache Technology Summary
    • thinkphp how to turn off caching
    • PHP Force Browser does not cache the method
    • PHP Cache page Functions
    • PHP Programmer Tutorial Website Advertising Service
    • Summary of methods used by PHP to save arrays as text formats
    • Use PHP function memory_get_usage to get the current PHP memory consumption to achieve program performance optimization

http://www.bkjia.com/PHPjc/764072.html www.bkjia.com true http://www.bkjia.com/PHPjc/764072.html techarticle the way Web programs get information is primarily querying the database, which is not a big problem when the database is not very large. However, with the development of the website, the database is growing exponentially ...

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