function cacheFreshnessFigure(host) { ensureStyles(); var parts = []; parts.push(''); parts.push('A. TTL alone: fresh until t_received + ttlMs'); parts.push(''); parts.push(''); parts.push(''); parts.push('fresh'); parts.push('stale'); parts.push(''); parts.push(''); parts.push('t_received'); parts.push('t_received + ttlMs'); parts.push('B. Notification during the window: stale immediately'); parts.push('list_changed notification'); parts.push(''); parts.push(''); parts.push(''); parts.push(''); parts.push(''); parts.push('fresh'); parts.push('stale'); parts.push(''); parts.push(''); parts.push(''); parts.push('t_received'); parts.push('ttl would end here'); var shell = document.createElement('div'); shell.className = 'mf-shell'; shell.innerHTML = [ '
Cache Freshness a TTL window ends on the clock, unless a notification ends it first
', '
', '', parts.join(''), '', '
', '
A cached response stays fresh until its ttlMs runs out, but a relevant list_changed notification invalidates it immediately on arrival, even with time left on the clock. TTL and notifications are complementary, not competing.
' ].join(''); host.appendChild(shell); } // register as: mcpa-20-cache-freshness