CircleCI Ideas

Retrieve list of existing build cache keys

With caches being immutable in 2.0, it would be very handy to be able to retrieve a list of the build cache keys. Ideally with some filtering options by repo or project, and also returning some useful metadata such as size, created_by_build_num, date_created and build_num_last_retrieved, date_last_retrieved, etc. Bonus points for the ability to retrieve cache contents, as inspecting the contents of these things can be very enlightening, as sometimes they don't contain what you think they do.

This would assist in "fault finding" of caches in the build process and greatly assist in effective cache utilisation.

  • Avatar32.5fb70cce7410889e661286fd7f1897de Guest
  • Aug 6 2018
  • Taking votes
API
  • Attach files
  • Admin
    Nathan Dintenfass commented
    August 06, 2018 21:34

    Agree this would be useful. Will add this to our investigation queue and see if we could get something into the API to accommodate it. 

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    September 19, 2019 18:44

    Since we have many downstream jobs that depend on one cache, we have one job to generate the cache. It would be useful to be able to know that a cache key exists and skip some subsequent steps. In our case, the cache building job restores the cache, then does effectively nothing (since the cache was up-to-date), then doesn’t save because the cache key as the same. Most of the task’s time is spent restoring the cache, but we could have aborted early if we just knew the key already existed.