1. install memcached-d install in Windows
Start memcached-d start in Windows
Disable memcached-d stop
1_1, three methods to access memcache
Memcache
Memcached
Php (not dependent on extended socket operations)
2. memcache extension (function) === access the cache system.
Install memcache extension (C-compiled Dynamic Link Library)
; Enable memcache Extension
Extension = php_memcache.dll
3. The server starts the memcached service.
4. Define classes in PHP,
Create the Person. class. php file
In the file in use, require "Person. class. php" introduces the definition
5. Multiple php data types can be stored and obtained in Memcache
// String int float boolean array object (serialized) null resource (for example, mysql connection cannot be put into memcache)
How to store resources can be used as a connection pool.
6. memcache/session/cookie has different scopes.
In each browser, the cookie stores the product that accessed the site and browses the product,
Session is associated with a file on the web server to save logon information. Each user can only access its own session.
Solutions for collecting statistics on online users (when the database is unavailable:
Solution 1: traverse the number of session files
Solution 2: memcached shared cache (recommended)
7. The system uses multiple memcache systems (multiple distributed storage systems) to balance multiple memcached servers.
8. core technologies for large websites
1) Static Page
2) cache (memcache ////)
8-1. memcached features
1. It is a c/s architecture that uses simple text for communication. Can be accessed by multiple clients
2. libevent-based event processing (java needs to handle various listeners by itself, but php does not listen much)
3. Memory-based Cache for faster speed.
4. distributed based on customers.
9. Write your own cache system with reference to various memcache processes !!!!