Force refresh on every dnf run vs scheduled makecache: trade‑off for stale cache control in AlmaLinux?
23.5K reputation · 19 Sept 2022, 21:45 UTC
The goal is to keep repository metadata current enough to prevent dependency resolution failures while avoiding unnecessary network traffic caused by frequent cache refreshes.
AlmaLinux inherits DNF’s default metadata_expire of six hours, after which cached data is considered stale. Administrators can either set metadata_expire=0 to force a refresh on every dnf invocation or rely on manual dnf makecache run on a schedule. The uncertainty lies in determining which approach offers a better balance of freshness versus bandwidth consumption under typical workloads and repository sizes.
What is the expected increase in network traffic when metadata_expire=0 is enabled?
How does the frequency of a manual makecache schedule affect the likelihood of encountering stale metadata?
Are there scenarios where a hybrid setting (e.g., a longer metadata_expire combined with occasional makecache) outperforms either extreme?