Repository navigation
v0.1.0 — Initial Release
quant-cache v0.1.0
Economic CDN cache optimization engine.
What it does
Formulates CDN cache admission as a 0-1 knapsack problem maximizing expected economic benefit (latency savings + origin cost reduction) under capacity and freshness constraints.
Highlights
- Scoring: per-object expected benefit with Poisson-based stale probability model
- Solvers: GreedySolver (O(n log n)) + ExactIlpSolver (HiGHS, n < 10k)
- Evaluation: trace replay with LRU/GDSF baselines, stale detection (TTL + version mismatch)
- CLI:
qc generate,qc optimize,qc simulate,qc compare - Presets: ecommerce, media, api — with configurable stale penalty overrides
Key Results
| Metric | Result |
|---|---|
| Optimality gap (median, n=1000) | 0.01% |
| Optimality gap (p95, n=1000) | 0.72% |
| Greedy solve 10k objects | 0.6ms |
| Trace replay 1M events | 825ms |
| 75 tests + 5 acceptance guards | All passing |
Quick Start
cargo build --workspace --release
qc generate --num-objects 10000 --num-requests 1000000 --output trace.csv
qc optimize --input trace.csv --output policy.json --capacity 50000000 --preset ecommerce
qc simulate --input trace.csv --policy policy.json
qc compare --input trace.csv --capacity 50000000 --preset ecommerceWhat's Next
- V1.1: CloudFront/Cloudflare log import + real trace validation
- V1.5: Belady baseline, offline coefficient calibration
- V2.0: QUBO with quadratic terms (co-access, purge-group, origin-group)
See docs/roadmap.md for the full plan.