A comprehensive analysis of PHP operation Memcache Basic function _php Instance

Source: Internet
Author: User

What's memcache?

Memcache is a danga.com project, the first to serve the LiveJournal, many people around the world use this cache project to build their own heavy load of the site to share the pressure of the database.

It can handle any number of connections and use non-blocking network IO. Because its working mechanism is to open up a space in memory, and then establish a hashtable,memcached self management of these hashtable.

Memcache Official website: http://www.danga.com/memcached, more detailed information can come here to understand:)
Why are there memcache and memcached two kinds of names?

In fact Memcache is the name of this project, and memcached is its server-side main program file name, know what I mean put ~ ~ ~ ~ ~ One is the project name, one is the main program file name, on the internet to see a lot of people do not understand, so mixed use.

The Memcache module provides a convenient process-oriented and object-oriented interface for memcached, memcached a resident process caching product that results from loading data from a database for dynamic Web applications. The Memcache module also provides a session processor (Memcache). The following PHP programmer Rechesson A detailed explanation of the PHP operation Memcache Basic functions.

Memcache-memcache class

memcache::add-Add an entry to the cache server

memcache::addserver-Add a Memcache server to the connection pool

memcache::close-Close Memcache Connection

memcache::connect-Open a memcached service-side Connection

Memcache::d ecrement-to reduce key value

Memcache::d elete-Remove a key from the server

memcache::flush-Clean (delete) All keys that have been stored

memcache::get-Check back a key from the service side

memcache::getextendedstats-all server statistics in the cache server pool

Memcache::getserverstatus-is used to get the online/offline status of a server

memcache::getstats-Get Server statistics

memcache::getversion-Return Server version information

memcache::increment-Add the value of a key

Memcache::p connect-to open a persistent connection to the server

Memcache::replace-replaces the value of a key that already exists

memcache::set-store value, no new key is added, existing key is replaced directly

Memcache::setcompressthreshold-Open Large Value automatic compression

memcache::setserverparams-Modify server parameters and status at runtime

Memcache function memcache_debug-conversion debug output on/off

The above is a small set to introduce the PHP operation Memcache Basic functions, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

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.