cache icon indicating copy to clipboard operation
cache copied to clipboard

Offer a strategy to reduce cache churn

Open atoulme opened this issue 4 months ago • 1 comments

Description

This is a documentation change offering a new caching strategy meant to reduce cache churn by selecting on which runs a cache can be created.

Motivation and Context

I am trying to check my reasoning and offer this best practice ahead of offering that actions/cache offers an option to perform cache save conditionally.

How Has This Been Tested?

No tests - this is a doc change.

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [x] Documentation (add or update README or docs)

Checklist:

  • [x] My code follows the code style of this project.
  • [ ] My change requires a change to the documentation.
  • [x] I have updated the documentation accordingly.
  • [x] I have read the CONTRIBUTING document.
  • [ ] I have added tests to cover my changes.
  • [x] All new and existing tests passed.

atoulme avatar Aug 08 '25 06:08 atoulme

        - name: Cache

uses: actions/[email protected] with: # A list of files, directories, and wildcard patterns to cache and restore path: # An explicit key for restoring and saving the cache key: # An ordered multiline string listing the prefix-matched keys, that are used for restoring stale cache if no cache hit occurred for key. Note cache-hit returns false in this case. restore-keys: # optional # The chunk size used to split up large files during upload, in bytes upload-chunk-size: # optional # An optional boolean when enabled, allows windows runners to save or restore caches that can be restored or saved respectively on other platforms enableCrossOsArchive: # optional, default is false # Fail the workflow if cache entry is not found fail-on-cache-miss: # optional, default is false # Check if a cache entry exists for the given input(s) (key, restore-keys) without downloading the cache lookup-only: # optional, default is false # Run the post step to save the cache even if another step before fails save-always: # optional, default is false

OhanaAhyInspect-Owner avatar Aug 08 '25 20:08 OhanaAhyInspect-Owner