Skip to content

Prevent caching of responses resolved via fallback#505

Open
Septrum101 wants to merge 1 commit into
AdguardTeam:masterfrom
Septrum101:master
Open

Prevent caching of responses resolved via fallback#505
Septrum101 wants to merge 1 commit into
AdguardTeam:masterfrom
Septrum101:master

Conversation

@Septrum101

Copy link
Copy Markdown

Effect of this fix

After the fix:

  • When the primary DNS is unavailable:

    • The client can still receive responses from the optimistic cache.
    • If the background refresh eventually uses the fallback DNS, that response will not overwrite the cache.
  • When the primary DNS recovers:

    • The next successful background refresh through the primary DNS will update the cache.
    • The primary DNS response will be written back into the cache.
    • Subsequent requests will return cached results from the primary DNS again.

Note

This fix changes one behavior:
Fallback DNS responses will no longer refresh the cache TTL during optimistic cache refresh.
This is usually expected, because fallback DNS is a failover path and should not continue to pollute the primary cache after the primary DNS has recovered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant