Apr 16, 2026 13:00:00

Hop into High

Performance

For 5 months
on all Web
hosting plans

  • 0

    Days

  • 0

    Hrs

  • 0

    Min

  • 0

    Sec

Claim Offer Now

Promo Code:HIGHSPEED

Cloud Hosting Glossary

Struggling to tell your APIs from your CDNs? Read our comprehensive cloud computing glossary covering the most common terms.

< Back to glossary

APC (Alternative PHP Cache)

APC, or Alternative PHP Cache, is a free and open-source opcode caching solution designed to improve the performance of PHP applications. It works by caching the compiled bytecode of PHP scripts in shared memory, reducing the need for repeated parsing and compilation during subsequent requests.

How APC Works

Opcode Caching: When a PHP script is executed, it is first parsed and compiled into opcode (machine-readable instructions). APC stores this compiled opcode in memory, so subsequent requests can skip the parsing and compilation steps, significantly improving execution speed.

User Data Caching: In addition to opcode caching, APC provides a shared memory cache for storing user-defined data, such as variables or objects, which can be accessed across multiple requests.

Benefits of APC

Performance Boost: Reduces server load and speeds up PHP applications by eliminating redundant script compilation.

Efficient Resource Utilization: Optimizes memory usage by storing frequently accessed data in shared memory.

Ease of Use: Simple to install and configure on servers running PHP.

Limitations of APC

Compatibility Issues: APC is compatible only with PHP versions up to 5.4. For later versions, Zend OPcache has become the standard opcode caching solution.

Development Status: APC development has been discontinued, but its user cache functionality continues as a separate extension called APCu.

Real-World Example

A high-traffic website using PHP can implement APC to cache commonly used scripts and database queries. This reduces the server’s workload and ensures faster response times for users. Alternatives to APC

Zend OPcache: Integrated into PHP since version 5.5, it provides similar opcode caching functionality with better performance and support for newer PHP versions.

APCu: A continuation of APC’s user cache features, allowing in-memory caching of application data without opcode caching.

Memcached or Redis: Distributed caching solutions that offer more robust features for large-scale applications.

In summary, while APC was once a popular choice for optimizing PHP performance, its use has declined with the introduction of newer technologies like Zend OPcache. However, its legacy continues through APCu for user data caching.