Implemented cache for tiles in factory.