DEV Community

Cover image for Boost Your WordPress Site with the Fastest APCu Object Cache Available
Christian Ahrweiler
Christian Ahrweiler

Posted on Originally published at Medium

Boost Your WordPress Site with the Fastest APCu Object Cache Available

atec Cache APCu combines an optimized persistent object cache with an optional APCu-powered page cache

Boost Your WordPress Site with the Fastest APCu Object Cache AvailableWordPress repeatedly loads options, settings, post metadata, user data, and database query results while generating a page. Many of these objects remain unchanged between requests, yet WordPress must retrieve and process them again.

A persistent object cache solves this problem by keeping reusable objects in memory. Instead of requesting the same data from the database every time, WordPress can retrieve it from the cache.

However, object caching only improves performance when the cache itself is extremely fast.

That is why I built atec Cache APCu.

Why APCu?

APCu stores data in shared memory and makes it directly available to PHP.

Unlike Redis or Memcached, APCu does not require WordPress to communicate with a separate cache server. There is no network connection, no socket communication, and no additional service waiting for requests.

The path is short:

WordPress → PHP → APCu memory

An external object cache requires a longer path:

WordPress → PHP → socket or network connection → cache server → response

Redis and Memcached are powerful solutions for distributed environments where several web servers need to share the same cache. But most WordPress sites run on a single server. In that environment, an external cache adds communication overhead without providing a practical advantage.

APCu keeps the cache where PHP can access it directly.

The Fastest APCu Object Cache Available

I tested atec Cache APCu against every other WordPress object-cache plugin I could find that supports APCu.

In my benchmark tests, atec Cache APCu was consistently the fastest.

That is why I describe it as the fastest APCu object cache available for WordPress. The claim is based on direct comparisons with the alternative APCu implementations — not simply on the theoretical performance of APCu itself.

The cache technology may be identical, but the implementation is not.

Every additional abstraction layer, function call, serialization step, compatibility check, or unnecessary cache operation adds overhead. WordPress may perform hundreds or even thousands of object-cache operations while generating a single page, so even a small difference per operation can become significant.

atec Cache APCu was designed to keep this critical path as short and efficient as possible.

Advanced Object Cache Mode

The PRO version includes Advanced Object Cache Mode, or AOC.

Standard WordPress object caches commonly serialize complex values before storing them and unserialize those values when retrieving them. APCu, however, can store PHP arrays and other values directly in memory.

AOC takes advantage of that capability.

By avoiding unnecessary serialize() and unserialize() operations, AOC reduces the processing required for cache reads and writes. This further improves object-cache efficiency on every WordPress request.

The result is a cache designed specifically for APCu rather than a generic object-cache implementation with APCu added as another storage option.

Object Cache and Page Cache in One Plugin

atec Cache APCu does more than provide a persistent object cache. It also includes an optional full-page cache powered entirely by APCu.

The two cache layers solve different problems.

The object cache stores reusable WordPress data, such as options, metadata, and database query results. WordPress still generates the page, but it can reuse data that is already available in memory.

The page cache stores the completed HTML output. When the same page is requested again, the cached version can be served without regenerating the entire page.

Using both layers can substantially reduce PHP execution and database activity.

The page cache includes:

  • Cache exclusion rules
  • Automatic handling of important dynamic pages
  • Cache flushing controls
  • Profiler and debugging options
  • Support for the DONOTCACHEPAGE constant
  • Automatic exclusion of WooCommerce cart, checkout, and account pages The PRO version also includes Advanced Page Cache Mode, which starts earlier than a regular WordPress page cache. It can serve a cached page before most of the WordPress application has been loaded.

Object Caching Is Not Always Faster

A persistent object cache does not guarantee better performance.

Each cache operation consumes time. The cache key must be processed, the stored value must be located, and the result must be returned to WordPress. If the cache backend is slow, retrieving an object can take almost as long as recreating it — or, in some cases, even longer.

This is especially relevant because WordPress performs so many individual object-cache operations during a request.

Object caching therefore requires very fast memory access. Otherwise, the cache can simply replace one bottleneck with another.

APCu is ideal for this task because it offers direct access to shared memory without the overhead of an external cache service.

When Redis Is the Better Choice

Redis remains the appropriate choice for WordPress installations that run across multiple servers.

Use Redis or another centralized cache when:

  • Several web servers must share the same cache
  • WordPress runs in a clustered environment
  • Other applications need access to the cached data
  • The cache must operate independently of the PHP runtime Most WordPress websites do not need this architecture. They run on a single shared-hosting account, VPS, or dedicated server.

For these installations, APCu provides a simpler and faster local object cache.

Redis offers greater flexibility for distributed systems. APCu offers lower overhead on a single server.

Is APCu Available on Your Server?

APCu is a PHP extension and must be enabled by your hosting provider or server administrator.

It is commonly available on VPS and dedicated-server installations, but some shared hosting providers do not enable it. APCu reserves server memory, which is one reason hosting companies may restrict its use.

You can check your PHP configuration in WordPress under:

Tools → Site Health → Info → Server

You can also install atec Cache APCu and use its server information and compatibility checks, or ask your hosting provider whether the APCu PHP extension is available.

For WP-CLI commands, APCu must also be enabled for the PHP command-line interface by setting:

apc.enable_cli=1

More Than 3,000 Active Installations

More than 3,000 WordPress sites already use atec Cache APCu.

The plugin provides:

  • A persistent APCu object-cache drop-in
  • An optional APCu full-page cache
  • Optimized cache operations
  • Cache statistics and memory information
  • Persistent object-cache group information
  • Cache exclusion and flushing controls
  • Profiler and debugging tools
  • A simple WordPress administration interface
  • No Redis or Memcached dependency
  • No separate cache server The only technical requirement is an APCu-enabled PHP installation.

Install atec Cache APCu

You can install the plugin directly from your WordPress dashboard:

  • Open Plugins → Add New Plugin
  • Search for atec Cache APCu
  • Install and activate the plugin
  • Open atec Cache APCu from the WordPress admin bar
  • Enable the object cache
  • Optionally enable the page cache You can also download it directly from the official WordPress Plugin Directory:

Download atec Cache APCu from WordPress.org

More information about atec Cache APCu, the PRO features, and other performance plugins is available at:

Visit atecplugins.com

Fast, Local, and Purpose-Built for WordPress

A cache should reduce the amount of work WordPress performs. It should not introduce another complicated system that must be installed, secured, monitored, and maintained.

atec Cache APCu keeps cached data where WordPress can access it fastest: directly inside PHP’s shared memory.

No separate cache server.
No network round trips.
No additional cache database.
No unnecessary abstraction layers.

Just the fastest APCu object cache available for WordPress.

Top comments (0)