日期:2014-05-16  浏览次数:20768 次

apache服务器 下的缓存配置

刚刚配置了下linux下apache的缓存配置,配置内容如下

<IfModule mod_cache.c>
#LoadModule disk_cache_module modules/mod_disk_cache.so
# If you want to use mod_disk_cache instead of mod_mem_cache,
# uncomment the line above and comment out the LoadModule line below.
<IfModule mod_disk_cache.c>

CacheRoot "/var/www/cacheroot"
CacheEnable disk /
CacheDirLevels 5
CacheDirLength 3

</IfModule> 

<IfModule mod_mem_cache.c>
CacheEnable mem /
MCacheSize 8192
MCacheMaxObjectCount 10000
MCacheMinObjectSize 1
MCacheMaxObjectSize 51200
</IfModule>

</IfModule>


配置完重启服务器,感觉速度是变快了,但是奇怪的是,我在"/var/www/cacheroot"下面却没有发现缓存文件 (之前已经导入mod_cache.so、mod_disk_cache.so和mod_mem_cache.so)

相关内容:http://httpd.apache.org/docs/2.2/mod/mod_cache.html