@@ -469,7 +469,7 @@ <h3 class="mb-3 text-sm font-medium text-gray-300">Live Activity</h3>
469469 </ div >
470470
471471 <!-- Prefix Cache Impact: current process only -->
472- < template x-if ="cacheSessionActive ">
472+ < template x-if ="hasPrefixCacheImpact ">
473473 < div class ="bg-surface rounded-lg p-4 border border-border mb-6 ">
474474 < div class ="flex justify-between items-center mb-3 ">
475475 < div class ="text-sm font-medium text-gray-300 "> Prefix Cache Impact</ div >
@@ -516,6 +516,13 @@ <h3 class="mb-3 text-sm font-medium text-gray-300">Live Activity</h3>
516516 < div class ="text-xs text-gray-500 " x-show ="!cacheSessionActive "> no activity since restart</ div >
517517 </ div >
518518 </ div >
519+ < template x-if ="lifetimeCacheReadTokens > 0 || lifetimeCacheSavingsUsd > 0 ">
520+ < div class ="rounded-lg border border-emerald-500/20 bg-emerald-500/5 p-3 mb-4 ">
521+ < div class ="text-xs text-gray-500 uppercase tracking-wide mb-1 "> Cache Reads (lifetime)</ div >
522+ < div class ="text-2xl font-light tabular-nums text-emerald-400 " x-text ="formatNumber(lifetimeCacheReadTokens) "> </ div >
523+ < div class ="text-xs text-emerald-400/70 " x-text ="'$' + formatCurrency(lifetimeCacheSavingsUsd) + ' saved' "> </ div >
524+ </ div >
525+ </ template >
519526 <!-- Cache efficiency bar (session-scoped; hidden until traffic arrives) -->
520527 < div x-show ="cacheSessionActive ">
521528 < div class ="flex justify-between text-xs text-gray-500 mb-1 ">
@@ -2478,6 +2485,20 @@ <h3 class="mb-3 text-sm font-medium text-gray-300">Live Activity</h3>
24782485 return ( this . stats . prefix_cache ?. totals ?. requests || 0 ) > 0 ;
24792486 } ,
24802487
2488+ get lifetimeCacheReadTokens ( ) {
2489+ return this . stats . persistent_savings ?. lifetime ?. cache_read_tokens || 0 ;
2490+ } ,
2491+
2492+ get lifetimeCacheSavingsUsd ( ) {
2493+ return this . stats . persistent_savings ?. lifetime ?. cache_savings_usd || 0 ;
2494+ } ,
2495+
2496+ get hasPrefixCacheImpact ( ) {
2497+ return this . cacheSessionActive
2498+ || this . lifetimeCacheReadTokens > 0
2499+ || this . lifetimeCacheSavingsUsd > 0 ;
2500+ } ,
2501+
24812502 get cacheSavingsPercent ( ) {
24822503 const t = this . stats . prefix_cache ?. totals || { } ;
24832504 const total = ( t . cache_read_tokens || 0 ) + ( t . cache_write_tokens || 0 ) ;
0 commit comments