Implemented cache factory.