()
| 105 | |
| 106 | impl Default for CacheConfig { |
| 107 | fn default() -> Self { |
| 108 | Self { |
| 109 | enabled: true, |
| 110 | max_memory_bytes: 1024 * 1024 * 512, // 512MB |
| 111 | l1_config: LevelConfig { |
| 112 | max_entries: 1000, |
| 113 | max_memory_bytes: 1024 * 1024 * 64, // 64MB |
| 114 | default_ttl: Some(Duration::from_secs(300)), // 5 minutes |
| 115 | policy: CachePolicy::ReadThrough, |
| 116 | }, |
| 117 | l2_config: LevelConfig { |
| 118 | max_entries: 5000, |
| 119 | max_memory_bytes: 1024 * 1024 * 256, // 256MB |
| 120 | default_ttl: Some(Duration::from_secs(1800)), // 30 minutes |
| 121 | policy: CachePolicy::ReadThrough, |
| 122 | }, |
| 123 | l3_config: LevelConfig { |
| 124 | max_entries: 20000, |
| 125 | max_memory_bytes: 1024 * 1024 * 192, // 192MB (remainder) |
| 126 | default_ttl: Some(Duration::from_secs(3600)), // 1 hour |
| 127 | policy: CachePolicy::WriteBack, |
| 128 | }, |
| 129 | eviction_policy: EvictionPolicy::Arc, |
| 130 | stats_interval: Duration::from_secs(60), |
| 131 | compression_enabled: true, |
| 132 | invalidation_strategy: InvalidationStrategy::Hybrid { |
| 133 | primary: Box::new(InvalidationStrategy::TagBased), |
| 134 | fallback: Box::new(InvalidationStrategy::Ttl), |
| 135 | }, |
| 136 | } |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | impl CacheConfig { |
nothing calls this directly
no outgoing calls
no test coverage detected