- 论坛徽章:
- 0
|
ats的官方文档说,当没有Expires或max-age头的情况下,ats会根据date, last_modified以及heuristic_lm_factor计算过期时间。
ats中相关配置如下:
CONFIG proxy.config.http.cache.heuristic_min_lifetime INT 3600
CONFIG proxy.config.http.cache.heuristic_max_lifetime INT 86400
CONFIG proxy.config.http.cache.heuristic_lm_factor FLOAT 0.100000
然后在源站创建文件pnow.jpg, 发起请求:
# wget -S --header "Host:test.ats.com" http://127.0.0.1/pnow.jpg?t1 -P /tmp/
--2013-04-02 22:17:09-- http://127.0.0.1/pnow.jpg?t1
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response...
HTTP/1.0 200 OK
Server: ATS/3.2.4
Date: Tue, 02 Apr 2013 14:17:09 GMT
Content-Type: image/jpeg
Content-Length: 483632
Last-Modified: Tue, 02 Apr 2013 14:00:00 GMT
Accept-Ranges: bytes
Age: 0
Connection: keep-alive
Length: 483632 (472K) [image/jpeg]
Saving to: `/tmp/pnow.jpg?t1.6'
100%[===================================================================================>] 483,632 --.-K/s in 0.002s
然而无论多少次请求,Age始终是0,源站有回源记录。
本次测试中,Last-Modified时间是 Tue, 02 Apr 2013 14:00:00 GMT, 请求date在这之后10~15分钟期间,根据freshness_limit = ( date - last_modified ) * 0.10的公式,在1~1.5分钟期间应该是fresh的,为什么实测看到的是没有缓存而回源了呢?
ats初学者,求解答。
|
|