Delayed cacheIf evaluation / after outputs are created

Hello there.

Regarding caching, AFAIK, cacheIf statements are evaluated as the task is starting to execute. Then the task moves on to do his business, and a cache entry is created based on what was determined before.

What if I wanted a way to still have conditional caching, but based on some condition derived from the outputs of the task, or if you want, a cacheIf that would be evaluated at the end of the task, based on the outputs it just produced?

Is this possible?