ARTIFACTORY: How to resolve the issue of the Smart Remote Repository not displaying new files in a timely manner

ARTIFACTORY: How to resolve the issue of the Smart Remote Repository not displaying new files in a timely manner

AuthorFullName__c
Sun Jinlong
articleNumber
000006307
FirstPublishedDate
2025-01-05T14:08:51Z
lastModifiedDate
2025-08-01
VersionNumber
7

Introduction 

The Smart Remote repository serves as a proxy for local, remote, or federated repositories from another Artifactory instance or an Edge node. Beyond the standard advantages of Remote Repositories, Smart Remote repositories also offer the List Remote Artifacts feature. This functionality allows you to browse the contents of the repository at the remote Artifactory instance across all package types, even if the artifacts have not yet been cached in your local Artifactory instance.  

User-added image

Nevertheless, there may be instances where the List Remote Artifacts feature fails to display items or folders from the proxied repository promptly.  
In the following example, Create A local repo named "test-generic-smart-repo" in Artifactory node A to proxy for the "example-repo-local" repo in Artifactory node B. 

User-added image

When first expanding the Artifactory node A smart repository in the Artifacts page at the first time, the Artifactory node A will initiate HTTP HEAD and GET requests to the Artifactory node B. These requests are dispatched to fetch artifacts info from the Artifactory node B repository and subsequently display them on the page in Artifactory node A. We can see the request information sent to the Artifactory node B in the artifactory-request-out.log of the Artifactory node A.

# Artifactory node A artifactory-request-out.log
2024-12-23T04:41:50.199Z|5e84631d7c77747a|test-generic-smart-remote|admin|HEAD|http://<art_url>/artifactory/example-repo-local/|200|0|0|243
2024-12-23T04:41:50.220Z|5e84631d7c77747a|test-generic-smart-remote|admin|GET|http://<art_url>/artifactory/example-repo-local/|200|0|0|9

User-added image

User-added image


However, when we upload a new file in Artifactory node B's example-repo-local repo, we may not see it in time in Artifactory node A's Smart Remote repo.

User-added image 

User-added image 

Root Cause


The timing of the List of Remote Artifacts in this Smart Remote repo depends on the "Remote Repository Metadata Retrieval Cache Period (Sec)". the "Remote Repository Metadata Retrieval Cache Period (Sec)" parameter dictates how long, in seconds, a remote repository can cache metadata files before it checks for a newer version on the remote server.Once the remote repository caches the metadata for the first time, this information is stored for the duration specified by this parameter. As a result, newly uploaded artifacts in the real-time proxy repository may not immediately appear in the current remote repository due to this caching period.

Resolution

1. To ensure that remote artifacts are displayed promptly, you can adjust the "Metadata Retrieval Cache Period (Sec)" parameter to a shorter value, default is 7200s. This reduction in cache duration will facilitate the timely reflection of the most recent artifact listings.

 

User-added image 

2. To expedite the process, we can utilize the "Zap Cache" feature. This function will force the Retrieval Cache Period and Missed Retrieval Cache Period to time out, the artifacts list will refresh when we re-expend the Smart Remote Repo.
Click the “Zap Cache” button in the Smart Remote Cache Repo to  forcing the Retrieval Cache Period and Missed Retrieval Cache Period to time out, When we re-expand the Smart Remote Repository the repo list will refresh and display the new artifact.

User-added image 

User-added image 

User-added image 
 

# Artifactory node A logs:
artifactory-service.log
2024-12-xxT02:31:57.160Z [jfrt ] [INFO ] [030051d606c83e9b] [o.a.r.d.DbCacheRepo:244       ] [ttp-nio-8081-exec-10] - Zapped 'test-generic-smart-remote-cache:' from local cache: 1 items zapped.

artifactory-request-out.log
2024-12-xxT02:12:41.746Z|05a6643b971c2e95|test-generic-smart-remote|admin|GET|http://<art_url>/artifactory/example-repo-local/|200|0|0|356
2024-12-25T02:32:04.770Z|74540750ef278dd3|test-generic-smart-remote|admin|GET|http://<art_url>/artifactory/example-repo-local/|200|0|0|1120