Cache time-to-live freshness model calculator

Calculate expected stale-time share and expected fresh-time share with your own figures.

Your numbers

Use the units shown. Results update as you change valid inputs.

Use expected stale-time share and expected fresh-time share to compare changes to your inputs. The method and limits below explain the scope.

Examples

Examples

Try the starting example

Independent source updates per hour
1
Fixed refresh interval / TTL (seconds)
3600
Independent requests per second
2
Expected stale-time share (%)
36.787944
Expected fresh-time share (%)
63.212056
Expected stale requests per refresh interval
2,648.731976
Mean cache age across interval (seconds)
1800

Try another scenario

Independent source updates per hour
0
Fixed refresh interval / TTL (seconds)
3600
Independent requests per second
2
Expected stale-time share (%)
0
Expected fresh-time share (%)
100
Expected stale requests per refresh interval
0
Mean cache age across interval (seconds)
1800
Calculation method

Calculation method

Expected stale-time share (%)

For Poisson updates with rate λ per second and fixed refresh T, stale share = 1 − (1 − exp(−λT))/(λT). At λT=0 use zero; use a series near zero.

Expected fresh-time share (%)

100% − stale-time share.

Expected stale requests per refresh interval

Request rate × refresh interval × stale-time share, assuming requests are independent and uniformly exposed to cache age.

Mean cache age across interval (seconds)

A proactive fixed refresh gives uniformly distributed age from 0 to T, whose mean is T/2.

Symbols and units
a
Independent source updates per hour
b
Fixed refresh interval / TTL (seconds)
c
Independent requests per second

Use the units shown. A list keeps the order in which you enter its values. The symbol ^ means “raised to the power of”.

Assumptions & limits

Assumptions & limits

  • Simplified proactive refresh at fixed TTL, instantaneous successful refresh, independent Poisson source updates and independent requests. This is not lazy expiry-on-request, cache hit ratio, a freshness guarantee or a model of correlated traffic.
Are these inputs private?

These calculations run in your browser. A shared link contains the values you choose to share. Only questions submitted to the separate AI finder are sent to OpenAI.

Further reading

OpenStax: arithmetic and geometry ↗

Background reading; this does not imply endorsement or independent review of SumFizz.

Share this page
Share this calculator

Leave unchecked to share the page without your entered values.