コード例 #1
0
        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 { })
コード例 #2
0
        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);
        }