The complete example for cache factory.