v1.0 released at 10/2006, v1.8 released at 06/2009
Open source, BSD License
Supports both disk-based cache and memory-based cache
Modcache ’ s advantages
Lighttpd based (it ’ s a powerful web server, far away beyond normal proxy server)
Works with other lighttpd modules, such as mod_compress / mod_access
Keep it as simple as possible
Small source code base (< 3000 lines)
Don ’ t use local db to store cache information
Modcache ’ s disadvantages
No internal cache files management (try /usr/sbin/tmpwatch)
Rules of cache are controlled by modcache, not by backend servers
Memory cache doesn ’ t share between different lighttpd processes
It ’ s a patch, not included in official lighttpd release
Modcache vs Squid
Without disk management
Reverse Cache only
Expire time based on refresh.pattern
Conditional config /ACL
Small source codebase
With disk management
Expire time based on backend response and refresh-pattern
Large source codebase
List of cache directories. For examples: cache.bases = ("/data/cache", "/data2/cache")
List of domains which modcache would try to cache for. When it isn’t set, modcache would cache files of every domains. for examples: cache.domains = ("(^|.)linux.com.cn$") caches *.linux.com.cn. domains.
Includes hostname in saved filename or not. default is disable.
Default is disable
Default is enable
Try to cache query with '?'. default is 'disable'. When cache.support-queries = "enable" and cache.dynamic-mode = "disable", modcache will treat "/uri?q1" or "/uri?q2" as "/uri" and save them to local cache file of "/uri". When cache.support-queries and cache.dynamic-mode are both enabled, modcache will treat "/uri?q1" and "/uri?q2" as different resource and save them to different local cache files.
To support dynamic generated web page such as forum/bbs. default is "disable". Note: cache.support-queries has to be enabled when dynamic-mode is enabled.
List of local program extension, such as ".php". modcache will replace them with ".cache.html" to aviod confliction with other modules, such as mod_fastcgi. default is not set
Number of MBytes which modcache will use to save cached content in memory. default is 256Mbytes.
Number of content removed from memory when memory is full. default is 256.
pcre regex hosts ip which are allowed to PURGE cache files. for examples: cache.purge-host="^200.100.1." allow 22.214.171.124/24 to purge cache. Default is not set
Key of modcache, idea from squid ’ s refresh-pattern
cache.refresh-pattern format is "url_pcre_regex" => "minutes options". Note: zero 'minutes' means cache forever and minutes option is mandatory.