Respect the order of cache entries

In our application, we're depending on the order of the cache entries (to include the javascripts dynamically in the DOM in proper order). This PR keeps the cache key computation independent of sorting order, while not mutating the `@config.cache` array.