An analysis of APC expansion in PHP (iv)

Source: Internet
Author: User
Before introducing the "System Cache Entries" and "User Cache Entries" page, first review the following (a) mentioned in the setting of the account and password, what is the use of this account password? Actually is used for these two pages, when we do not login, when viewing "System cache Entries", the specific path information of the cache file will be hidden, "User cache Entries" prompts you want to see the user variable is required to login, After landing the specific path of the cache file and user cached variable information will be displayed, the login button on the top right of the page, click "Login", enter the settings of the account and password to log on successfully.


"System Cache Entries": This page records all the cached PHP files.

1 script filename: The path and name of the cached scripts file

2 Hits: Hit count

3 Size: Cache file Size (this value is not the size of the file that occupies the computer, it is the size of the APC shared memory block)

4 Last accessed: End of file access time

5 Last Modified: Date Modified

6 Created at: Cache file creation time

7 Deleted at: Cache file Delete Time


"User Cache Entries": Users caches are similar to the system cache page parameters, the following list of different parameters, the same meaning of the parameters are no longer described.

1 user Entry Label: The key value of the user cache variable.

2 Timeout: The expiration time of the user cache variable.

3 Deleted at: Click "Delete Now" to manually delete the individual user cache variables.

Unlike the system cache, the user cache requires the user to manually add the fetch, here we need to use some of the functions APC provides to us, the following is a few common functions.

1 Apc_add (): Caches variables into the data store only if the cache variable does not exist. The name used to store the cache variable key is unique, so attempting to use apc_add () to add a cache with a name that already exists will not overwrite the existing cached value and return false.

2 Apc_store (): Caches a variable into the APC. The name used to store the cache variable key is unique, so two values use the same key, and the original will be overwritten with the new value.

3 Apc_fetch (): Gets the corresponding cache value based on key.

4 apc_exists (): Check if key exists.

5 Apc_delete (): Deletes a variable from the data store.

6 Apc_clear_cache (): Clears the user or system cache.

Summary:

1 after landing Benefit 1: You can view the specific path of the cache file; Benefit 2: You can view the user cache variable information; Benefit 3: You can clear the system cache and the user cache.

2 Apc_add and Apc_store both cache a variable into the APC, except that apc_add () will not overwrite the existing cached value when adding a cache with the name already present, and return false, while Apc_store () The original cache value is overwritten.

The above on the introduction of the APC extension of PHP (iv), including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

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