AdguardTeam / AdguardTeam/AdGuardHome

Improve optimistic DNS caching with single-flight background refresh

Aperta
#8,584 0 commenti 0 reazioni 1 assegnatario Rivendicata da @Chinaski1 Vedi su GitHub
feature request Priority: P4
Lingua principale
TypeScript
Stelle
36.9k
Fork
2.5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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_

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.