public async Task <ActionResult> Get(string id) { _logger.LogDebug("Getting file by id {Id}", id); // NOtes: force some Async IO that cannot be cached by the OS (like getting the file from a storage bucket) await _getStuffService.GetStuffAsync(); // now read the file and return var bytes = await System.IO.File.ReadAllBytesAsync("./large_image.jpg"); return(File(bytes, "image/jpeg")); }