Reduce number of params used in cache wrapper functions
This is a small refactoring in preparation for passing the cache kind
down to `generateCacheEntryWithCacheContext` so that we can use it for
the cache work unit store, without further increasing the number of
params used for this function and the other functions in the call
hierarchy.