1.memcache Introduction and Installation:
Download: Download the file and unzip it somewhere.
2. Data storage format
A key-value pair, a key that corresponds to a value, and a value that occupies one or more 4k blocks in memory.
3.php How to use Memcache
A: Install the PHP memcache extension on the server
B: Directly using the Php-memcached-client class library of the client
Download memcached-client.php, after downloading the memcached-client.php, you can use the class "memcached" in this file to operate the memcached service.
How to use 4.TP:
5. Common methods:
Add ($key, $value, $exp =0)//write object to memcached
Parameters: $key is the unique identifier of the object, $value is the object data written, $exp the expiration time, in seconds, the default is unlimited time
Get ($key)//Get Object data from memcached by $key Unique identifier of the object
Replace ($key, $value, $exp =0)//Replace the object content in memcached with an identifier $key in the $value
Delete ($key, $time = 0)//delete an object with an identifier $key in memcached, $time an optional parameter that indicates how long to wait before deleting.
Memcache Simple Getting Started app