根据我对缓存机制的理解,响应头Last-Modified
、请求头等If-Modified-Since
具有秒级的准确性,即If-Modified-Since: Wed, 21 Oct 2015 07:28:00 GMT
,因此亚秒级的修改会破坏失效:
12:00:00.100 /path/to/resource updated to Version 1
12:00:00.200 GET /path/to/resource from client A
12:00:00.300 Response: Version 1 of the page with Last-Modified: 12:00:00
12:00:00.400 /path/to/resource updated to Version 2
12:00:00.500 GET /path/to/resource from client A with If-Modified-Since: 12:00:00
12:00:00.600 Response: 304 Not Modified
# and even after time passes
16:15:00.000 GET /path/to/resource from client A with If-Modified-Since: 12:00:00
16:15:00.100 Response: 304 Not Modified
并且在缓存过期之前,客户端永远不会获得页面的版本 2。
真的是这样吗?存储在页面中的版本是否应该总是将页面的最后修改日期增加一秒?