Home > Backend Development > PHP Tutorial > 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
Release: 2024-10-29 18:37:26
Original
1015 people have browsed it

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>
Copy after login

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!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template