刚刚配置了下linux下apache的缓存配置,配置内容如下
[code=""]
<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>
[/code]
配置完重启服务器,感觉速度是变快了,但是奇怪的是,我在"/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
[code=""]
<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>
[/code]
配置完重启服务器,感觉速度是变快了,但是奇怪的是,我在"/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
本文分享了在Linux环境下配置Apache缓存的具体步骤,并详细展示了如何启用disk_cache和mem_cache模块来提高网站加载速度。虽然配置后服务器响应更快,但作者却发现预设的缓存目录中未生成任何缓存文件。
781

被折叠的 条评论
为什么被折叠?



