AdguardTeam / AdguardTeam/AdGuardHome
Improve optimistic DNS caching with single-flight background refresh
- 主要語言
- TypeScript
- 星號
- 36.9k
- 分支
- 2.5k
- PR 合併指標
- 30 天內沒有已合併 PR
描述
### Prerequisites
- [x] I have checked the [Wiki](https://github.com/AdguardTeam/AdGuardHome/wiki) and [Discussions](https://github.com/AdguardTeam/AdGuardHome/discussions) and found no answer
- [x] I have searched other issues and found no duplicates
- [x] I want to request a feature or enhancement and not ask a question
### The problem
Optimistic/stale cache behavior can reduce latency, but stale refreshes need careful coordination. Without a controlled refresh path, multiple requests can trigger redundant refreshes or clients may see inconsistent latency around expiration.
### Proposed solution
Enhance optimistic cache handling so stale-but-eligible entries can be served immediately while exactly one background refresh is active for a cache key.
The feature could include:
- A bounded stale-serving window.
- Single-flight refresh per cache key.
- Clear rules for which response types are eligible.
- Refresh failure handling that does not corrupt the existing cache entry.
- Counters for stale serves, refresh attempts, successful refreshes, failures, and deduplicated refreshes.
This would make optimistic caching more predictable and easier to diagnose.
### Alternatives considered and additional information
_No response_
貢獻指南
評估
這個 Issue 還沒有評估資料。