Memcached-in PHP, is it faster to put data in the cache, or to include it through include?

Source: Internet
Author: User
I am a novice, the specific execution mode of PHP is not very clear.
Some of the basic configuration parameters of the site, is to save in the database using memcache memory better? Or is the configuration used to read and write files in the php file, and then through the include directly use it?
Which one is more efficient?
I feel that the latter, because without the link memcache cache to read the data, you can use the variable directly. But not sure, a bit ambiguous, I hope the Master can tell me which kind of better, efficiency who is higher, PHP is how to use memory.
Extremely grateful!!

Reply content:

I am a novice, the specific execution mode of PHP is not very clear.
Some of the basic configuration parameters of the site, is to save in the database using memcache memory better? Or is the configuration used to read and write files in the php file, and then through the include directly use it?
Which one is more efficient?
I feel that the latter, because without the link memcache cache to read the data, you can use the variable directly. But not sure, a bit ambiguous, I hope the Master can tell me which kind of better, efficiency who is higher, PHP is how to use memory.
Extremely grateful!!

If you install an APC such as buffer opcode extension, it must be stored as fast as PHP, or the memory is fast.

Put it in the PHP file quickly, if you say the content is a configuration file Ah

The simplest and quickest way is to do a contrast test.

This depends on whether you are the memory level of the cache or file level, if the use of Redis,memcache and the like must be faster than include, but also depends on the size of your include file, the impact of many factors, if only a simple applet with include no problem

Save in PHP array, then save to database, database temp table into memory mode

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