Sometimes it's useful to prepare a directory for caching by removing some bits that should not be cached. This could be done directly in the command but it seems better to group with the caching configuration.
Specific motivating example is the target directory for Rust, which contains both third party dependencies which are of highest value to cache, and incremental compilation of local crates which are large and low value (or sometimes broken) to cache. Inspiration from the https://github.com/Swatinem/rust-cache GitHub Actions plugin.