Safeguard
Developer Tools•

What do Verdaccio uplink settings like maxage and max_fails do?

Verdaccio uplink keys control caching, metadata freshness, timeouts and failure windows. Defaults, what each does, and effects on outages and security.

Safeguard Security Team
3 min read

A Verdaccio uplink is a remote registry it proxies. The uplink keys cache, maxage, timeout, fail_timeout and max_fails decide whether tarballs are stored, how long metadata stays fresh, and when Verdaccio stops asking a failing upstream. Defaults are true, 2m, 30s, 5m and 2.

The settings

From the Verdaccio uplinks documentation:

KeyDefaultPurpose
cachetrueCache remote tarballs in storage
maxage2mHow long cached metadata stays valid
timeout30sRequest timeout for the uplink
fail_timeout5mWindow after which a request counts as a failure
max_fails2Maximum failed requests allowed
authdisabledSets the Authorization header
headersdisabledCustom headers sent to the uplink

Durations use NGINX style units such as 100ms, 10m or 30s.

What this means for freshness

maxage is about metadata, the list of versions and tags. With the default 2m, Verdaccio re-checks the upstream for new versions frequently. A longer value reduces upstream traffic and makes installs less dependent on the upstream being up. It also means a new release, or a corrected one, takes longer to show.

For security this cuts both ways. A malicious version published upstream appears in your mirror within minutes at the default. A longer maxage delays that a little, but it is no substitute for a deliberate delay or review policy, because the time scale is minutes, not days.

What this means for outages

With cache: true, tarballs fetched once are stored, so repeat installs of the same version do not need the upstream. That is the outage protection many teams want from a mirror. Install versions you need at least once through the mirror while the upstream is healthy, for example in a CI warm up job, so they are cached.

timeout, fail_timeout and max_fails govern how Verdaccio treats a flaky upstream. Short timeouts make installs fail fast when the upstream is slow, while long ones make builds hang. Tune them to what your pipeline can tolerate.

Tarballs on other hosts

The docs note that Verdaccio fetches a tarball only from a URL that a configured uplink serves. Registries that host tarballs on a separate CDN host are fetched through an autogenerated proxy that appears in logs as verdaccio-<package>. With log level http, each tarball fetch is logged with its target and uplink, and a refused off uplink fetch is logged as a warning, "refused off-uplink tarball fetch".

That warning is worth alerting on. It tells you that a package metadata file pointed somewhere your configuration did not expect.

Review checklist

  1. Which uplinks exist, and does each package pattern name the right one?
  2. Is cache on for uplinks you rely on during outages?
  3. Is maxage a deliberate choice rather than the default?
  4. Are timeouts shorter than your CI job timeout?
  5. Are warning logs shipped and watched?

Safeguard's dependency scanning and SBOM generation help you see what your mirror delivered, with a free scan at gold.safeguard.sh/scan.

Quick check

Does maxage control how long tarballs are kept?

No. It controls how long cached package metadata is treated as valid. Tarball storage follows the cache setting.

Does a mirror protect me from a new malicious version?

Not by itself. With a short maxage, new upstream versions appear quickly. Add a review or delay policy.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.