# `NervesHubLink.UpdateManager.CachingUpdater`
[🔗](https://github.com/nerves-hub/nerves_hub_link/blob/v2.12.0/lib/nerves_hub_link/update_manager/caching_updater.ex#L5)

This module orchestrates firmware updates by downloading the firmware
from the specified URL and storing it in a cache directory before applying it.
If a partial download exists, it resumes from where it left off.

This is useful for resuming firmware updates from a previous attempt, allowing for
efficient updates even if the connection is lost or the device is rebooted. It also
ensures that the firmware is stored locally, reducing the need for repeated downloads.

To use this strategy, you need to configure NervesHubLink with:

    config :nerves_hub_link,
      updater: NervesHubLink.UpdateManager.CachingUpdater,

The default directory used for storing the caches is `/data/nerves_hub_link/firmware`.
You can configure the path by using the `cache_dir` option in your
application's configuration. For example:

    config :nerves_hub_link, NervesHubLink.UpdateManager.CachingUpdater,
      cache_dir: "/path/to/cache/directory"

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `send_update?`

# `start_link`

```elixir
@spec start_link(
  NervesHubLink.Message.UpdateInfo.t(),
  NervesHubLink.FwupConfig.t(),
  fwup_public_keys :: [],
  GenServer.options()
) :: GenServer.on_start()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
