Offline Mirror for mix deps?

There are multiple layers of caching for the different stages of fetching dependencies. We will always try to use the cache if it’s available but that does not necessarily mean we make no HTTP requests if everything is cached.

First of mix deps.get will not do anything if you already have fetched dependencies in the projects deps/ directory and they match the lock. If dependencies are missing in deps/ or they do not match the lockfile they will be fetched.

Before fetching dependencies we may need to do dependency resolution in case dependencies are not locked or they are being updated with mix deps.update. To perform dependency resolution we need to fetch package indexes from the registry. Package indexes are cached but we will always make conditional HTTP requests [1] for them to ensure you have the latest version of the index, if you have the latest version they are not downloaded again.

When dependencies are resolved to a specific version their package tarballs can be fetched, the tarballs are also cached so if you fetched the tarball previously on the same machine and the checksum matches then no request will be made.

[1] HTTP conditional requests - HTTP | MDN

4 Likes