Home  >  Article  >  Backend Development  >  How to Clear All APC Cache Entries: System, User, and Per-Directory?

How to Clear All APC Cache Entries: System, User, and Per-Directory?

DDD
DDDOriginal
2024-10-29 18:37:26937browse

How to Clear All APC Cache Entries: System, User, and Per-Directory?

Clearing APC Cache Entries

When deploying a new version of a site, it may be necessary to clear all APC cache entries. While APC.php provides a button for clearing opcode caches, there are no apparent options for erasing all User Entries, System Entries, or Per-Directory Entries.

Command-Line Solution

One method for clearing all cache entries is to leverage the PHP function apc_clear_cache. Invoking apc_clear_cache() will purge the system cache, and calling apc_clear_cache('user') will clear the user cache.

Example:

<code class="php"><?php
// Clear system cache
apc_clear_cache();

// Clear user cache
apc_clear_cache('user');
?></code>

The above is the detailed content of How to Clear All APC Cache Entries: System, User, and Per-Directory?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn