Add a cache factory.