gpt4 book ai didi

http - 为什么在 HTTP age 计算中需要对 corrected received age 加上 response delay?

转载 作者:可可西里 更新时间:2023-11-01 17:10:46 28 4
gpt4 key购买 nike

RFC 2616 Sec 13.2.3给出如下年龄计算算法:

apparent_age = max(0, response_time - date_value);
corrected_received_age = max(apparent_age, age_value);
response_delay = response_time - request_time;
corrected_initial_age = corrected_received_age + response_delay;
resident_time = now - response_time;
current_age = corrected_initial_age + resident_time;

Where

age_value: is the value of Age: header received by the cache with this response.
date_value: is the value of the origin server's Date: header
request_time: is the (local) time when the cache made the request that resulted in this cached response
response_time: is the (local) time when the cache received the response
now: is the current (local) time

我的问题是,为什么需要将 response_delay 添加到 corrected_initial_age?

我的理解是 response_time - date_value 已经包括响应生成和接收之间的延迟,所以如果我们添加 response_delay 那么我们也包括服务器生成和接收请求之间的时间。

例如,如果客户端在时间 0 (request_time = 0) 发送请求,则在时间 4 (response_time = 4) 收到响应(没有年龄 header age_value = 0)并且日期 header 为 2 (date_value = 2)。

apparent_age = max(0, 4 - 2) = 2
corrected_received_age = max(2, 0) = 2
response_delay = 4 - 0 = 4
corrected_initial_age = 2 + 4 = 6
resident_time = 8 - 4 = 4
current_age = 6 + 4 = 10

如果 aparent_age 值看起来是正确的,为什么我们应该将 corrected_received_age 加 4?只是为了考虑任何可能的时钟偏差?我错过了什么吗?

最佳答案

即将发布的 RFC 2616 修订版将调整该算法,请参阅 http://greenbytes.de/tech/webdav/draft-ietf-httpbis-p6-cache-22.html#age.calculations了解详情。

关于http - 为什么在 HTTP age 计算中需要对 corrected received age 加上 response delay?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17045815/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com