Home > Article > Backend Development > 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!