Caching for reducible data structures