BlogComparisons · November 9, 2026 · 6 min read

Contact Form 7 Lead Deduplication Caches: Redis vs Valkey vs Memcached vs KeyDB vs Dragonfly

Compare five caches for short-lived duplicate suppression. See what expiration, eviction and failover mean for the durable lead record.

When a worker receives the same Contact Form 7 handoff twice within a few seconds, a shared cache can help it avoid doing the same expensive lookup twice. The cache can also disappear just before the second worker reads it. Design for both outcomes. The useful comparison is how each store claims an absent key, expires it and behaves under pressure, while a durable record remains responsible for deciding whether to create a lead.

A chip, hourglass and matching tokens flank a gate leading toward a closed ledger.
Generated conceptual illustration; not a product screenshot or measured result.

Five caches for a temporary duplicate hint

Product First claim Check before rollout
Redis Conditional SET with expiry. Version-specific licensing and maxmemory policy.
Valkey Conditional SET with expiry. Client compatibility across topology changes.
Memcached add with an expiration. Eviction, node replacement and client key routing.
KeyDB Redis-style conditional SET. Exact release, client and replication semantics.
Dragonfly Redis-style conditional SET. Cache-mode behavior and terms for the chosen release.

These are infrastructure options for a custom integration. The comparison covers documented operations and failure modes. It does not assume an out-of-the-box CF7 connector, a throughput ranking or a guarantee that a repeated write is impossible.

Redis

The Redis SET reference documents NX for an absent key and EX or PX for expiration. Use one conditional operation rather than a read followed by an unconditional write. It avoids the obvious race where both workers see no key. The successful claim describes the cache operation only. It says nothing about whether the CRM call happened or whether the application saved the result.

The strength is a widely documented command and explicit maxmemory policies. The limitation is that an evicting policy can remove a live hint before its TTL, whereas a no-eviction setup can reject a new write at the memory limit. Check client error handling for both outcomes. The license matrix distinguishes 7.2 and earlier, 7.4, and Redis 8 and later, which offer RSALv2, SSPLv1 or AGPLv3. Redis Cloud has separate service pricing. Confirm the version and hosted capacity rather than transferring a license assumption from another installation.

Valkey

Valkey SET supports conditional creation and expiry in one command. The BSD 3-Clause license is a reason to shortlist it when you want permissively licensed self-hosted software. If you already have an appropriate client, start by exercising this small subset of commands rather than migrating a broader integration solely for this use case. Your costs still include runtime capacity, monitoring and the work of operating it, or the price of a managed service.

Its eviction options make the tradeoff testable. A cache shared with unrelated large values may be much more volatile than a dedicated one. The limitation appears at failover: even a compatible command and successful reply do not establish that the replacement node can see the hint. Check reconnection, timeouts and key routing in your chosen topology. Keep every worker pointed at the same intended namespace.

Memcached

The Memcached text protocol supports add, which stores the item only if it is absent. Set an explicit short expiration. Zero means no expiration; values greater than 30 days are interpreted as absolute Unix times. Confirm how the client expresses these options and reports a failed claim or a network failure. Keep the key compact and free of spaces for the ASCII protocol. The project ships under a BSD 3-Clause license.

Its strength is a small cache interface when losing the hint is an expected part of your design. The operational limitation is that a routing change, eviction or restart can make a previously stored item unavailable. A client that hashes the same key differently after a node change may see a miss even when the old node is still running. Use it if your durable check is cheap enough to handle these misses and your team already knows how to run the client pool. Self-hosting has infrastructure costs even without a software subscription.

KeyDB

KeyDB is a multithreaded Redis fork with Redis protocol compatibility; its repository includes a BSD 3-Clause license. A small conditional set with an expiry is a useful fixture if you already operate KeyDB. Check the exact packaged release and client for conditional-set options and verify that losing a connection produces a distinguishable error rather than being silently interpreted as an existing key.

The strength is reusing an existing Redis-style integration and operating knowledge. The limitation is that project lineage cannot establish that every recent Redis command option, topology feature or client expectation is identical. In particular, do not treat a claim in one region as a globally exclusive lock across writable replicas. Verify the release and maintenance path, test your real topology with two clients, and budget for the hosts and support your deployment requires.

Dragonfly

Dragonfly documents its SET options and describes eviction with cache mode. Reusing the same command shape is useful if you are evaluating a Redis-compatible cache. The practical test is whether your release and client preserve the expected replies on contention, memory pressure and reconnects. Measure with the size and lifetime of the hints you intend to store. A general vendor performance claim does not predict that workload.

Licensing is a current decision point. The November 4 announcement describes earlier BSL 1.1 releases and a different source-available license beginning with Enterprise 2.1. The vendor describes free production use up to 100 vCPUs under its terms and commercial licensing above that threshold. Check the exact artifact and agreement before committing to an upgrade or managed offering. A compatible command interface does not make the earlier and current release terms interchangeable.

Give each cached hint a documented lifetime based on observed overlap between duplicate deliveries, not the maximum time a lead may remain open. For example, a 30-second hint might cover two deliveries arriving together, while the durable record still covers a retry the following day. If the first worker runs longer than that hint, the second worker must still be prevented from repeating a committed action by the durable check. Observe misses, claim conflicts, cache errors and unresolved handoffs as separate counters.

Choose for the failure your worker must survive

Test two workers with the same opaque inquiry and destination key. Expect one initial claim while the key is present. Then test eviction, expiry during processing, a cache timeout, and a crash after a destination write but before local acknowledgement. When the cache says the key is present, leave enough evidence to resume a legitimate inquiry. When it misses or cannot be reached, consult a durable idempotency record or a documented destination lookup rather than assuming a write is safe. Avoid a key derived solely from an email address: one person can make two valid inquiries. Keep personal data out of cache keys and ordinary logs.

Use Redis or Valkey when the conditional-set workflow fits your existing client and license policy. Choose Memcached for a deliberately disposable hint and a team already comfortable with node routing. Keep KeyDB in the shortlist when its deployed release and maintenance fit the job. Consider Dragonfly when you can validate the client behavior and the current terms. For a low-volume connector, start with the durable check alone and add a cache only when you can demonstrate a useful reduction in duplicate work.

For the underlying handoff, see the duplicate submissions guide, the background job comparison and the batch reconciliation guide. Our free Svetlik Analytics for Contact Form 7 plugin reports WordPress submission trends; the integration owns its own durable delivery record.