:cache.uri-pattern:
pattern to hash local cache files into different dirs prefixed by cache.bases. useful for
backends that have more than hundrends of thousands files. for example: cache.uri-pattern = "16 128″ will
hash local cache files into cache.bases/[0-15]/[0-127]/ directories(total 2048 dirs).
:cache.domains:
pcre array that control which domains that cached for. default to all. for
examples: cache.domains = ("\.linux\.com\.cn") set mod_cache only cache .linux.com.cn files.
:cache.denyurls:
pcre urls which don't cache. process before cache.refresh-pattern
:cache.offline-mode:
when it's set, mod_cache always uses local cache files. default to disable
:cache.support-queries:
enable or disable to cache query request. default to disable
:cache.refresh-pattern:
key of mod_cache. fformat is "url_pattern" => "expires options ...", url_pattern is pcre string.
expires is a number in minutes, zero means never expire. options are following one:
- nocache. don't cache
- update-on-nocache. when browser send "Cache-Control: no-cache", try to update cache from backend.
- fetchall-for-range-request. when browser sends "Range: bytes xxx-yyy", try to get all content from backend, useful for multi-threaded downloader.
- handle-queries. treat different querys as different files, effective only when cache.support-queries is enabled. useful for dynamic content.
Example:
========
cache setting for www.linux.com.cn:
cache.bases = ("/data/lighttpd_cache", "/data1/lighttpd_cache")
#cache.uri-pattern = "16 64″
#cache.debug = "enable"
cache.domains = ("www\.linux\.com\.cn$")
#cache.deny-questionmark-uri = "disable"
#cache.denyurls = ("\.php$", "\.jsp$")
cache.refresh-pattern = (
"\.(?i)(js|css)$" => "1440 update-on-nocache",
"\.(?i)(htm|html)$" => "1440 update-on-nocache handle-queries",
"\.(?i)(jpg|bmp|jpeg|gif|png)$" => "240″,
"\.(?i)(rar|zip|wmv|avi|mp3|ape|rm|swf|mpeg|mpg|wma|asf|rmvb)$" => "0 fetchall-for-range-request"
"." => "0 nocache"
)
proxy.worked-with-mod-cache = "enable"
proxy.balance = "round-robin"
$HTTP["host"] == "www.linux.com.cn" {
proxy.server = ( "/" => ( ( "host" => "10.x.x.x", "port" => 80 )))
}
什么时候发布啊?
我可以用用看。
初步看了下,用来做图片服务器的前端貌似很不错哦,
mod_cache+squid+lighttpd as real image servers
等不及你发布了。