AdguardTeam / AdguardTeam/AdGuardHome

Improve optimistic DNS caching with single-flight background refresh

未關閉
#8,584 0 則留言 0 個 reaction 已指派 1 人 已被 @Chinaski1 認領 在 GitHub 檢視
feature request Priority: P4
主要語言
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 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。