Build the cache key properly if there are multiple types

3.0-unstable version of #2406
Merge pull request #2407 from jamesgol/transload-3

Build the cache key properly if there are multiple types