Skip to main content

> Term

Freshness Contract

An agreed-upon timeframe indicating how long cached data can be served before it is considered unacceptably stale.

Detailed Explanation

A freshness contract explicitly sets the expectation between frontend and backend about data accuracy. It prevents the infinite debate of 'why isn't the UI updating?'

Why It Matters

It forces product managers and engineers to mathematically define what 'real-time' actually means for a specific feature.

Common Failure Mode

Giving a highly dynamic metric (like stock availability) a 24-hour freshness contract because 'it makes the page load faster'.

Practical Example

Setting a 5-minute TTL on a blog post cache, but a 5-second TTL on the e-commerce shopping cart.

Production Manifestation

Time-To-Live (TTL) settings in Redis, HTTP Cache-Control headers, or background polling intervals.

Frequently Asked Questions

What is Freshness Contract in short?

An agreed-upon timeframe indicating how long cached data can be served before it is considered unacceptably stale.

What is the most common failure mode?

Giving a highly dynamic metric (like stock availability) a 24-hour freshness contract because 'it makes the page load faster'.

AI Summary

An agreed-upon timeframe indicating how long cached data can be served before it is considered unacceptably stale. It forces product managers and engineers to mathematically define what 'real-time' actually means for a specific feature.