function handleUncachedResponse (
  dispatch,
  globalOpts,
  cacheKey,
  handler,
  opts,
  reqCacheControl
) {
  if (reqCacheControl?.['only-if-cached']) {
    let aborted = false
    try {
      if (typeof handler.onConnect === 'function') {
        handler.onConnect(() => {
          aborted = true
        })

        if (aborted) {
          return
        }
      }

      if (typeof handler.onHeaders === 'function') {
        handler.onHeaders(504, [], () => {}, 'Gateway Timeout')
        if (aborted) {
          return
        }
      }

      if (typeof handler.onComplete === 'function') {
        handler.onComplete([])
      }
    } catch (err) {
      if (typeof handler.onError === 'function') {
        handler.onError(err)
      }
    }

    return true
  }

  return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler))
}
@param {DispatchFn} dispatch
@param {import('../../types/cache-interceptor.d.ts').default.CacheHandlerOptions} globalOpts
@param {import('../../types/cache-interceptor.d.ts').default.CacheKey} cacheKey
@param {import('../../types/dispatcher.d.ts').default.DispatchHandler} handler
@param {import('../../types/dispatcher.d.ts').default.RequestOptions} opts
@param {import('../../types/cache-interceptor.d.ts').default.CacheControlDirectives | undefined} reqCacheControl