Refactor id generation of the cache.

The id is now generated within the percolator.