How to overwrite cache?



How to overwrite cache?
I think that if cache key already exists, It’s overwrite.

Skipping cache generation, cache already exists for key: cache_key
Found one created at 2017-06-06 04:10:46 +0000 UTC


I’d support the topic starter here. It would be nice to have the option like “Drop the cache” next to the “Rebuild without cache”.

“Drop the cache” would take the key defined in circle yml and attempt to drop it while running the build (on Restore the cache step), resulting the cache being re-generated after the successful build.

What does everybody think about this?


Thanks for reply.

Ok, I want to use force regenerate cache.
Like this

  key: key1
  path: /tmp/foo

  key: key2
  path: /tmp/var
  force: yes  => regenerate cache `key2`


I want this too. I restore my node_modules from cache (using package.json as a key), then run npm install anyway because it might well pick up new dependency patches, even if my package.json hasn’t changed since last build.

Until CircleCI gives us a way to drop the cache (or force-saving it regardless of whether the cache key already exists), my cached node_modules folder will fall further and further behind until my package.json next changes.


I would like to see that implemented as well. The complexity is much higher if I have only the choice of renewing the cache by adding new keys.


Agreed, there’s needs to be more tooling around cache management. The suggestion from the documentation about just incrementing an arbitrary version number in the cache key prefix is not a good enough solution.


This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.