2009-10-22 28 views

回答

31

the spec,它用于年龄计算。如果您不知道服务器认为它是什么时间,那么您将无法计算资源的“年龄”。下面是从规范中的有关内容:

年龄计算算法,当缓存收到响应摘要:

age_value
是时代的价值:头被缓存, 此接受响应。

date_value
是原始服务器的Date:头的值

request_time
是当缓存取得导致这种缓存响应的请求 (本地)时间

response_time
是当缓存收到 响应

now
(本地)时间为当前(当地)时间

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; 
+0

啊,OK。那么日期不一定是最后一次修改?如果我理解正确,那么更“服务器什么时候开始发送这些东西?”。这是有道理的...... – Boldewyn 2009-10-23 06:57:12

+0

@Boldewyn没错 - 这是“**消息**的起源日期和时间”。 – 2013-01-02 23:54:28

+0

@DanielLubarov不仅仅是可以发送Date标题的响应,它也不值得。它也支持请求,在客户端建立时间是有用的。不幸的是,它通常不是我所能看到的 – 2018-02-21 13:06:35

相关问题