code: function cache (methodName, cache) {
      // require valid name
      requireValidName(methodName)
      // get method
      var method = this[methodName]
      // require method
      this.assert(defined(method), `method name ${methodName} not defined`)
      // require cache specification
      cache = requireValidOptionalObject(cache)
      // set default cacheClient if not defined
      if (!defined(cache.cacheClient)) {
          cache.cacheClient = this.meta.options.cacheClient
      }
      // validate cache client
      requireValidCacheClient(cache.cacheClient)
      // get immutable global data store
      var immutable = global.__immutable_core__
      // require immutable global to exist
      this.assert(defined(immutable), 'global.__immutable_core__ not defined')
      // create cache entry for module if it does not exist
      if (!defined(immutable.caches[this.meta.name])) {
          immutable.caches[this.meta.name] = {}
      }
      var moduleCaches = immutable.caches[this.meta.name]
      // get global cache entry if any
      var globalCache = moduleCaches[methodName]
      // throw error if attempting to add multiple caching rules to the same method
      this.assert(!defined(globalCache) || !globalCache.cached || immutable.defaultAllowOverride, `cache already defined for ${methodName}`)
      // create global cache entry
      if (!defined(globalCache)) {
          globalCache = moduleCaches[methodName] = cache
      }
      // set global cache as cached
      globalCache.cached = true
      // set cache for method
      method.meta.cache = cache
  }
docs: @function cache
  
  define cache rules for method.
  
  the cache object can include the following parameters:
  
  cacheClient - object conforming to require-valid-cache-client spec.
  if cacheClient is not defined then method will fall back
  to cacheClient defined on the module which in turn falls
  back to the global default cache client
  
  expire - expire time. non-positive integer will never expire
  
  keyMethod - function that will be called with args and method meta data
  on every module method call and must return the cache key.
  if not defined default key generation method will be used.
  
  @param {string} methodName
  @param {string} cache
  
  @returns {undefined}