Filesystem
While the Intelligent Cache provides substantial performance gains it may be undermined by some filesystem assumptions.
Removal
Removing files is generally antithetical to CI and especially to incremental builds. Generating the files takes time and so too removing them. Since CI is a controlled environment, generating undesired files should be avoided whenever possible.
Ignore
When generating undesired files is unavoidable, ignoring them is the next best option. Many tools have mechanism for
ignoring, for example: .dockerignore or tar --exclude.
Incremental
Besides taking time to remove the files, doing so can cause problems for incremental jobs.
Imagine an incremental job that executes a set of development tools before removing them to create an artifact. During a subsequent run, the development tools will not be present to execute.
Instead of removing the development tools, one of the following would perform better.
- filter out the tools while creating the artifact
- create the artifact in a subsequent job that is not incremental