Can this be DRYed up? Something like:

    if(config$data_loading || config$cache_loading) {
      # load out of cache
    }

    if(config$data_loading) {
      # load things from data
    }