How It Works Pricing Benchmarks
vs Redis Docs Resources Blog
Start Free Trial
Cache Contracts

Your Cache Now Has
Enforceable SLAs.

Define freshness contracts per key. The engine enforces them — proactively refreshes before expiry, alerts when contracts can't be met, reports compliance metrics. Auditable caching for regulated industries.

Per-Key
SLAs
Proactive
Refresh
Compliance
Metrics
Zero
Stale Violations
The Problem

Every Cache Today Is Best-Effort

TTL expires and you hope someone re-fetches. There is no guarantee the data is fresh, no audit trail proving it was fresh, and no alerting when it goes stale. For regulated industries, this is not acceptable.

TTL Is Best-Effort
TTL sets a maximum age, not a freshness guarantee. When the TTL expires, the key is evicted — but there is no mechanism to ensure the value was fresh at any point during that window. No alerting. No audit trail. No proof. You set a timer and hope for the best.
No guarantee data is fresh during TTL window
📋
Compliance Requires Proof
SOC 2 auditors ask “how fresh is your cached data?” FINRA requires audit trails on financial data. HIPAA demands current patient records. Today, no cache can answer these questions. There are no freshness reports, no compliance metrics, no violation logs. The auditor's question has no answer.
Zero compliance visibility in any cache
💸
Stale Data Has Real Cost
A stale price in trading is a regulatory risk and a financial loss. Stale inventory in e-commerce oversells products and triggers refunds. A stale patient record in healthcare can mean wrong dosages. Stale cache data is not a technical inconvenience — it is a business liability.
Stale data = regulatory risk + revenue loss
How It Works

Define Freshness. The Engine Enforces It.

You attach a freshness SLA to any cache key at write time. Cachee's contract engine schedules proactive refreshes, monitors compliance, and logs every event.

# Set a key with a freshness contract and a refresh source SET user:123:balance <value> SLA FRESH_WITHIN 100ms REFRESH_FROM GET /api/users/123/balance # The engine guarantees: # 1. The value is proactively refreshed BEFORE 100ms expires # 2. If the refresh source is unreachable, an alert fires # 3. Every refresh and violation is logged with timestamps # 4. Compliance metrics are updated in real time # Multiple keys, different contracts SET stock:AAPL:price <value> SLA FRESH_WITHIN 50ms REFRESH_FROM GET /api/market/AAPL SET patient:456:vitals <value> SLA FRESH_WITHIN 200ms REFRESH_FROM GET /api/patients/456/vitals SET inventory:sku:789 <value> SLA FRESH_WITHIN 500ms REFRESH_FROM GET /api/inventory/789 # Every key has its own freshness guarantee, its own refresh schedule, # and its own compliance record. Hand this to your auditor.

Proactive, Not Reactive

TTL waits for the key to expire and then hopes someone fetches fresh data. Cache contracts are proactive. The engine schedules a refresh before the contract window closes. The value is always fresh when you read it — not because you got lucky on timing, but because the engine guaranteed it.

If the refresh source is unreachable or returns an error, the engine fires an alert immediately. You know the contract is at risk before any client sees stale data. TTL gives you silent staleness. Contracts give you loud failures.

Every Event Is Logged

Every proactive refresh, every contract violation, every source failure, and every recovery is logged with a timestamp and the key name. This log is the audit trail that regulated industries require and no cache has ever provided.

The difference between “we think the data was fresh” and “here is the timestamped proof that the data was refreshed 47ms before the contract window closed, from this source, with this response code” is the difference between failing an audit and passing one.

Compliance Dashboard

Hand This to Your SOC 2 Auditor

Cache contracts expose real-time compliance metrics for every key and every prefix. Exportable reports. API access. Zero manual tracking.

Cachee Compliance Dashboard — Cache Contracts
Contract Compliance
99.97%
Last 30 days
Violations
3
stock:* prefix — source timeout
Mean Freshness
34ms
Across all contracted keys
P99 Staleness
82ms
99th percentile age at read time
Refresh Success Rate
99.99%
Source reachability
Contracted Keys
14.2K
Active SLA enforcement
Available via dashboard, metrics API, and exportable CSV/JSON reports. Violation logs include key name, contract terms, refresh timestamp, source response code, and resolution time.
Degradation & Backpressure

When the Source Is Slow or Down, The Contract Still Holds

An SLA is only trustworthy if there’s a defined degradation behavior. Cache Contracts include write-through backpressure — principled answers for what to serve and for how long when the source system can’t keep up.

Source Slow

If refresh latency exceeds the contract threshold, Cachee serves the last-known value and marks it DEGRADED. The refresh continues in background. No blocking, no timeout cascade.

🚫

Source Down

If the source is unreachable, Cachee serves stale data for a configurable GRACE_PERIOD (e.g., 30s, 5m). After grace expires, returns an error rather than silently serving data that’s too old. You choose the policy.

📈

Backpressure Metrics

Every degradation event is logged with timestamp, key, contract, actual staleness, and source response time. Dashboard shows: degradation %, grace period usage, source health score. The audit trail is complete even during failures.

The command: SET price:AAPL 182.50 SLA FRESH_WITHIN 100ms REFRESH_FROM GET /api/prices/AAPL GRACE_PERIOD 30s ON_DEGRADE SERVE_STALE ON_EXPIRE RETURN_ERROR

If the price API is slow: serve last-known price, flag as degraded. If the API is down for >30 seconds: return an error rather than serve a 30-second-old price to a trading desk. The operator defines the contract. The engine enforces it. The audit trail proves it.
Use Cases

Where Freshness SLAs Are Non-Negotiable

Cache contracts turn caching from a liability into a compliance asset in industries where stale data has consequences.

📈
Trading
Price staleness is regulatory risk. A 50ms FRESH_WITHIN contract on market data keys ensures prices are never older than the contracted window. Violation logs provide the audit trail regulators require.
Price freshness = regulatory compliance
🏥
Healthcare
HIPAA requires current patient data. A 200ms FRESH_WITHIN contract on patient vitals keys guarantees that clinical systems display current records. Every refresh is logged for HIPAA audit.
Patient data freshness = HIPAA compliance
🏦
Finance
FINRA audit trails cover every data path, including cached data. Cache contracts generate the compliance reports that auditors need: violation counts, freshness distributions, and timestamped refresh logs per key prefix.
Auditable freshness = FINRA ready
🛒
E-Commerce
Stale inventory means overselling. Stale prices mean margin loss. A 500ms FRESH_WITHIN contract on inventory and pricing keys prevents both. The engine refreshes inventory counts before the contract expires.
Inventory accuracy = revenue protection
Composition

Composes With Every Cachee Primitive

Cache contracts are not a standalone feature. They compose with CDC, dependency graphs, and coherence to provide freshness guarantees at every layer.

💾
CDC + Cache Contracts
CDC provides event-driven freshness: when the database changes, the cache updates immediately. Cache contracts provide time-bound freshness: even without a CDC event, the value is refreshed on schedule. Together, they guarantee both reactive and proactive freshness. If CDC fires first, the contract is satisfied early. If CDC is delayed, the contract catches it.
Event-driven + time-bound = zero gaps
🔗
Dependency Graph + Cache Contracts
When a contracted key depends on other keys via the dependency graph, the freshness guarantee propagates. If user:123:dashboard has a 100ms FRESH_WITHIN contract and depends on user:123:balance, the engine ensures the balance is fresh before refreshing the dashboard.
Contracts propagate through dependency chains
🔄
Coherence + Cache Contracts
Coherence ensures that contract refreshes propagate across every instance in the namespace. When the engine refreshes a contracted key on one instance, the fresh value is distributed to all instances. Every instance meets the SLA, not just the one that triggered the refresh.
Cross-instance SLA enforcement
Comparison

Why Nobody Else Has This

No caching system offers per-key freshness contracts, compliance metrics, or proactive refresh with violation alerting. Here is the landscape.

Platform Freshness Model Cachee Cache Contracts
Redis TTL only — fire-and-forget, no audit trail Per-key SLA with proactive refresh + compliance log
Memcached TTL only — no SLA model, no metrics FRESH_WITHIN contracts with violation alerting
Hazelcast Near-cache TTL — no per-key SLA, no compliance Per-key freshness guarantees + exportable reports
Caffeine / Guava refreshAfterWrite — local only, no compliance metrics Distributed SLA enforcement + full audit trail
Every L1 / CDN Cache No freshness guarantee, no compliance reporting Enforceable, auditable, per-key freshness contracts
Best-effort caching is a demo.
Contracted caching is production.
FAQ

Frequently Asked Questions

What are cache contracts?

Cache contracts are per-key freshness SLAs that you define at write time using the FRESH_WITHIN modifier. When you SET a key with a freshness contract, Cachee guarantees that the cached value will never be older than the specified duration. The engine proactively refreshes the value before the contract expires, alerts when it cannot meet the SLA, and logs every refresh and violation for compliance reporting.

How does FRESH_WITHIN work?

FRESH_WITHIN is a modifier on the SET command that establishes a freshness contract. For example: SET user:123:balance <value> SLA FRESH_WITHIN 100ms REFRESH_FROM GET /api/users/123/balance. The engine schedules a proactive refresh before the 100ms window expires. If the refresh source is unreachable, an alert fires and the violation is logged. The cached value is never served past its contract without explicit acknowledgment.

Does it add latency to cache reads?

No. Reads are identical to any other cache GET — sub-microsecond, zero overhead. The freshness contract is enforced asynchronously by the engine's refresh scheduler. The scheduler runs a background timer per contracted key and triggers the refresh before the contract window expires. The only work is the background refresh itself, which happens entirely outside the read path.

How does it work with CDC auto-invalidation?

CDC and cache contracts are complementary. CDC invalidates keys when the source database changes (event-driven freshness). Cache contracts guarantee that even without a CDC event, the value will be refreshed within the contracted window (time-bound freshness). Together, they provide both reactive and proactive freshness. If CDC fires before the contract window, the value is already fresh. If CDC is delayed or the source is not a database, the contract catches it.

What compliance reports does it generate?

Cachee exposes per-key and per-prefix compliance metrics: contract compliance percentage, total violations, mean freshness age, p99 staleness, refresh success rate, and a full audit log of every refresh and violation event with timestamps. These metrics are available via the dashboard, the metrics API, and as exportable CSV/JSON reports suitable for SOC 2, FINRA, and HIPAA audits.

Stop Hoping Your Cache Is Fresh.
Enforce It. Prove It. Audit It.

Per-key freshness contracts. Proactive refresh. Compliance metrics. The cache SLA that regulated industries have been waiting for.

Start Free Trial Schedule Demo