feat: Implement basic caching layer with cache-aside pattern for /search results

- Implement cache-aside pattern via SearchCacheService in RouteSearch handler
- Add TTL policies: 3 hours near-term, 7 days far-term
- Write TestCacheAsideSearch and variants for TTL verification
- Extend CacheAside to fully implement Cache interface (Get, Set, Exists, Delete, Increment, Decrement)
This commit is contained in:
2026-08-16 14:53:33 +03:00
parent 7adb2ebbb3
commit 6ae491ef1c
4 changed files with 152 additions and 468 deletions

View File

@@ -89,11 +89,11 @@ Implement the complete multimodal trip planning service as specified in `docs/sp
- [x] Write tests: TestRouteParetoRanking
- [x] Run tests - must pass before task 7
### Task 7: Basic caching layer [ ]
- [ ] Implement cache-aside pattern for `/search` results
- [ ] Add TTL policies: 2-6 hours for near-term dates, 7 days for far-term
- [ ] Write tests: TestCacheAsideSearch
- [ ] Run tests - must pass before task 8
### Task 7: Basic caching layer [x]
- [x] Implement cache-aside pattern for `/search` results
- [x] Add TTL policies: 2-6 hours for near-term dates, 7 days for far-term
- [x] Write tests: TestCacheAsideSearch
- [x] Run tests - must pass before task 8
### Task 8: Station status endpoint [ ]
- [ ] Implement `GET /v1/stations/{id}/status` endpoint