Compress cache key.

Reorganize a bit.