cache If
Cache the results of the task only if the given spec is satisfied. If the spec is not satisfied, the results of the task will not be cached.
You may add multiple such predicates. The results of the task are not cached if any of the predicates return false
, or if any of the predicates passed to doNotCacheIf returns true
. If cacheIf()
is not specified, the task will not be cached unless the @CacheableTask annotation is present on the task type.
Consider using cacheIf instead for also providing a reason for enabling caching.
Since
3.0
Parameters
specifies if the results of the task should be cached.
Cache the results of the task only if the given spec is satisfied. If the spec is not satisfied, the results of the task will not be cached.
You may add multiple such predicates. The results of the task are not cached if any of the predicates return false
, or if any of the predicates passed to doNotCacheIf returns true
. If cacheIf()
is not specified, the task will not be cached unless the @CacheableTask annotation is present on the task type.
Since
3.4
Parameters
the reason why caching would be enabled by the spec.
specifies if the results of the task should be cached.