automatic cache building for categories