AdGuardHome icon indicating copy to clipboard operation
AdGuardHome copied to clipboard

Configuration changes to cache_optimistic_answer_ttl and cache_optimistic_max_age made via YAML are overwritten when saving settings via WebUI

Open ferrysqo opened this issue 1 month ago • 4 comments

Prerequisites

Platform (OS and CPU architecture)

Linux, MIPS LE

Installation

GitHub releases or script from README

Setup

On a router, DHCP is handled by the router

AdGuard Home version

v0.107.79

Action

Modified AdGuardHome.yaml directly using WinSCP to change cache_optimistic_answer_ttl to 1h and cache_optimistic_max_age to 3h, saved the file, and then saved any settings change via the WebUI.

Expected result

The manually configured cache values in the YAML file should be respected and retained when saving configurations through the WebUI.

Actual result

Whenever any setting is saved through the WebUI, AdGuard Home overwrites those two optimistic caching fields back to their default values (1s and 3h).

Additional information and/or screenshots

Chronology / Full Step-by-Step Details:

  1. I checked the initial AdGuardHome.yaml configuration and found the default optimistic caching values: cache_optimistic_answer_ttl: 1s cache_optimistic_max_age: 3h

  2. I accessed the router via WinSCP, edited the AdGuardHome.yaml file directly, and manually changed the values to: cache_optimistic_answer_ttl: 1h cache_optimistic_max_age: 3h

  3. I saved the file and restarted the service/router to apply changes. The values were successfully loaded and retained until the next step.

  4. The issue occurs whenever I make and save ANY unrelated configuration changes through the WebUI (e.g., modifying filtering rules, clients, or general settings).

  5. Upon clicking "Save" in the WebUI, AdGuard Home overwrites the YAML file, automatically reverting those two custom cache parameters back to their default values (1s and 3h). It seems the WebUI state pushes its in-memory defaults and overrides manual YAML modifications for these specific fields.

Image

ferrysqo avatar Oct 16 '26 20:10 ferrysqo

I think your mistake is to edit YAML file while AdGuardHome is started. First stop AdGuarHome service, then edit the YAML file, and finally start AdGuardHome service. This applies each time you want to manually edit YAML file, but not required if you set values and settings from WebUI.

alelaba avatar Oct 16 '26 20:10 alelaba

Ah, I see! That makes total sense. Thank you for pointing that out and helping me solve the issue.

I think your mistake is to edit YAML file while AdGuardHome is started. First stop AdGuarHome service, then edit the YAML file, and finally start AdGuardHome service. This applies each time you want to manually edit YAML file, but not required if you set values and settings from WebUI.

Thank you very much for the explanation! Stopping the service before editing the YAML file solved the issue. I really appreciate your help.

ferrysqo avatar Oct 16 '26 21:10 ferrysqo

The default values should be 12 hours and 30 seconds respectively- not 1 second and 3 hours respectively

Dynamic5912 avatar Oct 16 '26 22:10 Dynamic5912

Expected behavior. The wiki says to stop the service before editing AdGuardHome.yaml, because a running instance overwrites the file on save. The reporter confirmed the fix. The upstream defaults are 30s and 12h, not 1s and 3h.

GulnazSalakhova avatar Oct 19 '26 12:10 GulnazSalakhova