To configure Artifactory for direct cloud storage download, follow the steps below:
- Specify the repositories that should redirect requests for direct download
- Fine-tune the configuration with direct download parameters
- Configure your firewall to allow direct downloads
Once you have completed these steps, requests to Artifactory for downloads from any of the specified repositories will receive HTTP 302 responses with a signed URL directing the client to the S3 object storage for direct download.
Specifying Repositories for Direct Download
Artifactory can be configured to redirect requests for direct download at the level of repositories (there is no global configuration to automatically redirect all requests). This allows you to support both clients that support download redirect responses (HTTP 302) as well as those that do not. Download redirection is supported for all repository types - local, remote and virtual. For local and remote repositories configured for redirection, all requests are redirected. For virtual repositories, it depends which aggregated local or remote repository ultimately provides the requested artifact. If that repository is configured for redirection, then the requesting client will receive the corresponding redirection response, otherwise, Artifactory will fetch the requested artifact and provide it to the client as usual without redirection.
You can configure Artifactory to redirect requests for direct download in the following ways:
Remote repositories must be configured to store artifacts locally
Artifactory can only redirect requests for direct cloud storage download if the requested artifact is available locally. For local repositories, this is the natural state, however, for remote repositories, you have the option to configure the repository NOT to cache artifacts locally by deselecting the Store Artifacts Locally checkbox in the Advanced tab of the repository configuration (or by setting
storeArtifactsLocally=false when creating or updating the repository using REST API). Therefore, for remote repositories, you need to ensure that the repository is configured to store artifacts locally (i.e., Store Artifacts Locally checkbox is checked, or
storeArtifactsLocally=true). Failing to do so will generate an error.
Using the UI
To configure a local or remote repository to redirect requests for direct download, set the Enable Direct Cloud Storage Download checkbox in the Advanced tab of the repository configuration.
Using the REST API
To configure a local or remote repository to redirect requests for direct download using the REST API, set the
downloadRedirect attribute to be
false). For example:
Alternatively, you can set the
downloadRedirect parameter in the repository configuration JSON to be true.
Using the YAML Configuration File
If you are configuring repositories using a YAML file, you can use the
For example, to configure a repository called "generic-remote" for direct download:
where "remote.yaml" is:
Fine-Tuning Direct Download
One of the benefits of the direct cloud storage downloads feature is that it reduces the load on Artifactory registries when multiple download requests for large artifacts must be served simultaneously. But this benefit is only really realized when the artifacts being downloaded are indeed large. To let you fine-tune Artifactory's behavior with this feature, in Artifactory's General Configuration, you can set the minimal artifact size for which a download request may be redirected for direct cloud storage download using the Minimum Direct Cloud Storage Download Size parameter (the default is 5 MB).
Getting Through Firewalls
When direct cloud storage downloads are enabled in Artifactory, it means that artifacts requested will actually be served from the S3 domain rather than from Artifactory's domain. Since this domain is constant in the signed URLs Artifactory provides, you should add it to your organization's firewall to enable smooth and unhindered downloads. The domain you should add are: