当时用的是Squid 2.6,动态页面跟错误页面都缓存了,这两个必须避免。
下面是当时记录的文档:
TCP_NEGATIVE_HIT
When a request to an origin server results in an HTTP error, Squid may cache the response anyway. Repeated requests for these resources, within a short amount of time, result in negative hits. The negative_ttl directive controls the amount of time these errors may be cached. Also note that errors are cached only in memory and never written to disk. The following HTTP status codes may be negatively cached, subject to additional constraints: 204, 305, 400, 403, 404, 405, 414, 500, 501, 502, 503, 504.
可以用negative_ttl设置错误页面的生存时间。negative_ttl的文档在http://www.squid-cache.org/Doc/config/negative_ttl/,现在的默认值已经是0了。
No comments:
Post a Comment