Travis CI build caching limits with dynamic dependency updates
22K reputation · 22 Jul 2023, 12:01 UTC
Cache Persistence and Dependency Rotation
Travis CI provides a cache key in the .travis.yml configuration to persist directories across builds, which is typically used for node_modules or vendor folders to optimize execution time.
When dependencies are updated frequently, relying on a static cache key can lead to stale artifacts being injected into new builds. While rotating the cache key manually is a known workaround, there is uncertainty regarding the optimal balance between cache hit rates and the risk of dependency drift in high-velocity environments.
- What are the documented limits for automatic cache invalidation when the underlying dependency manifest changes?
- Is there a mechanism to programmatically trigger a cache refresh without modifying the
.travis.ymlfile?