PHP Memcache Learning Notes _php Tutorials

Source: Internet
Author: User
1, win under installation, memcached-d install
Win under Start, memcached-d start
Close, memcached-d stop

1_1, three ways to access memcache
Memcache
Memcached
PHP (not dependent on extended socket operation)

2, Memcache extension (function) = = = Access to the cache system.
Installing the Memcache extension (c-Compiled dynamic-link library)

; Enable Memcache Extension
Extension=php_memcache.dll

3, the service side start memcached service

4, the definition of class in PHP ,
Create a file Person.class.php
Require "Person.class.php" in the file used, introducing the definition

5, Memcache can store and get a variety of PHP data types
string int float Boolean Array object (after serialization) null resource (for example: MySQL connection is not put into memcache)

How resource can be put in, can be used as a connection pool.

6, the scope of Memcache/session/cookie is different.
Cookies in each browser, save the product that visits the site, browse what,
Session associates a file with a session on the Web server, saving the login information. The respective user can only access their session.
To count the solutions for accessing users online (when the database cannot be used):
Scenario One: Traverse the number of session files
Scenario Two: memcached shared cache (recommended)

7, the system uses multiple Memcache systems (multiple components of distributed storage) memcache self-balancing multiple memcached servers

8, do the core technology of large-scale website
1) page static
2) cache (memcache////)

8-1, the characteristics of memcached
1. Is the C/s architecture, using simple text to communicate. Multiple Client access available
2. Based on Libevent event processing (Java needs to handle a variety of monitoring, PHP is not listening)
3. Memory-based caching, faster.
4. Distributed based on the customer.

9, the reference memcache various processing, writes own cache system!!!!

http://www.bkjia.com/PHPjc/327602.html www.bkjia.com true http://www.bkjia.com/PHPjc/327602.html techarticle 1, win under installation, memcached-d install win under Start, memcached-d start off, memcached-d stop 1_1, three ways to access memcache memcache memcached php (not dependent on extended so ...

  • Related Article

    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.