Module cache

Source
Expand description

Cache the contents of a particular directory between runs.

The contents of the provided dir will be saved at the end of a run, using the user-defined key string to tag the contents of the cache.

Subsequent runs will then use the key to restore the contents of the directory.

§A note of file sizes

This node is backed by the in-box Cache@2 Task on ADO, and the in-box actions/cache@v3 Action on Github Actions.

These actions have limits on the size of data they can cache at any given time, and potentially have issues with particularly large artifacts (e.g: gigabytes in size).

In cases where you’re intending to cache large files, it is recommended to implement caching functionality directly using NodeCtx::persistent_dir, which is guaranteed to be reliable (when running on a system where such persistent storage is available).

§Clearing the cache

Clearing the cache is done in different ways depending on the backend:

  • Local: just delete the cache folder on your machine
  • Github: use the cache tasks’s web UI to manage cache entries
  • ADO: define a pipeline-level variable called FloweyCacheGeneration, and set it to an new arbitrary value.
    • This is because ADO doesn’t have a native way to flush the cache outside of updating the cache key in the YAML file itself.

Structs§

Node
(see module-level docs)
Request

Enums§

CacheHit
Status of a cache directory.
CacheResult
How the result of the cache task should be reported.