# Inexact cache key match

**URL:** <https://discuss.circleci.com/t/inexact-cache-key-match/40251>\
**Category:** Bug Reports\
**Created:** [June 1, 2021, 3:50pm UTC](https://discuss.circleci.com/t/inexact-cache-key-match/40251 "2021-06-01T15:50:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen-ONeil](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/stephen-oneil/32/27507_2.png) [@Stephen-ONeil](https://discuss.circleci.com/u/Stephen-ONeil)\
**Post date:** [June 1, 2021, 3:50pm UTC](https://discuss.circleci.com/t/inexact-cache-key-match/40251/1 "2021-06-01T15:50:51Z")

</div>

Was rolling out a new set of dockerfiles that were incompatible with caches from earlier CI jobs. On the branch with the new dockerfiles, I appended `-v2` to all the cache keys in my CircleCi config. This prevented the new branch from trying to use an incompatible old cache, but the surprise was that other branches with the _old_ dockerfiles/config (no `-v2` in cache keys) started matching, loading, and choking on caches created by the _new_ branch! Seems that, some how, the appended `-v2` was ignored when matching on the cache key.

Screen shots and links:  
**New** branch with `-v2` cache keys, running as build 32848, saving cache with key `top-level-dependencies-2UvLC_bLutn8MPZlWngM2b2WcSg0N1hWMRaskhr8HTo=-v2`

 ![image](https://global.discourse-cdn.com/circleci/original/3X/c/8/c8dc160989d76185c45daa5538225fd8d1a05650.png)  
[https://app.circleci.com/pipelines/github/TBS-EACPD/infobase/4387/workflows/6e334e26-af4c-4ae5-9082-f3e6b3deb8ae/jobs/32848](https://app.circleci.com/pipelines/github/TBS-EACPD/infobase/4387/workflows/6e334e26-af4c-4ae5-9082-f3e6b3deb8ae/jobs/32848)

**Old** branch with non`-v2` cache keys, `Found a cache from build 32848 at top-level-dependencies-2UvLC_bLutn8MPZlWngM2b2WcSg0N1hWMRaskhr8HTo=`. Appears to have made an inexact match, ignoring the appended `-v2`!  
(oops, limited to one media upload, but this one is easy enough to see by following the link)  
[https://app.circleci.com/pipelines/github/TBS-EACPD/infobase/4389/workflows/8b75456d-2590-4344-9dc8-25a35dd68437/jobs/32864](https://app.circleci.com/pipelines/github/TBS-EACPD/infobase/4389/workflows/8b75456d-2590-4344-9dc8-25a35dd68437/jobs/32864)
