private static async ValueTask <CachedResponse> CloneAsync(bool isAsync, Response response) { CachedResponse cachedResponse = new CachedResponse(response.Status, response.ReasonPhrase, response.Headers) { ClientRequestId = response.ClientRequestId, }; if (response.ContentStream is { })
internal static async ValueTask <CachedResponse> CreateAsync(bool isAsync, Response response, TimeSpan ttl) { CachedResponse cachedResponse = await CloneAsync(isAsync, response).ConfigureAwait(false); cachedResponse.expires = DateTimeOffset.Now + ttl; return(cachedResponse); }