code: func installConfigBackend(c context.Context, s *Settings, be backend.B, ccfg cacheConfig) context.Context {
  	if be == nil {
  		// Non-testing, build a Backend.
  		be = getPrimaryBackend(c, s)
  	}
  
  	// Apply caching configuration.
  	if exp := s.CacheExpiration(); exp > 0 {
  		// Back the raw service with a global cache.
  		if ccfg.GlobalCache != nil {
  			be = ccfg.GlobalCache(c, be, s)
  		}
  
  		// Add a formatting Backend. All Backends after this will use the
  		// formatted version of the entry.
  		be = &format.Backend{B: be}
  
  		// After raw service, install data-level caching.
  		if ccfg.With != nil {
  			c = ccfg.With(c, be, s)
  		}
  
  		if ccfg.DataCache != nil {
  			be = ccfg.DataCache(c, be, s)
  		}
  	}
  
  	c = backend.WithBackend(c, be)
  	return c
  }
docs: // installConfigBackend chooses a primary backend, then reenforces it with
  // caches based on the configuration.
  //
  // The primary backend is a live LUCI config service if configured, a permanent
  // error service if not configured, or a debug service if running on a
  // development server.
  //
  // If caching is enabled, this is re-enforced with the following caches:
  // - A memcache-backed cache.
  // - A datastore-backed cache (if enabled).
  // - A per-process in-memory cache (LRU).
  //
  // Lookups move from the bottom of the list up through the top, then to the
  // primary backend service.