$sudo a2enmod disk_cache
在虚拟主机配置文件中加入
<IfModule mod_disk_cache.c>
CacheEnable disk /
CacheRoot /var/www/bolg.mytest.com/cache
CacheDefaultExpire 7200
CacheMaxExpire 604800
</IfModule>
$sudo mkdir /var/www/bolg.mytest.com/cache
$sudo chown www-data.www-data /var/www/bolg.mytest.com/cache
$sudo /etc/init.d/apache2 restart
访问了下主页,但cache下没有缓存内容,是怎么回事?
disk_cache 怎么没用,看看哪里错了
- cloudor
- 帖子: 23
- 注册时间: 2009-08-04 21:43
disk_cache 怎么没用,看看哪里错了
lifefre.com
-
- 帖子: 1
- 注册时间: 2009-07-31 8:59
Re: disk_cache 怎么没用,看看哪里错了
我也有这种问题,怎么没有人回答啊,还请高手指点一下哈!
- link_01
- 帖子: 1024
- 注册时间: 2008-11-05 13:24
Re: disk_cache 怎么没用,看看哪里错了
ubuntu的disk_cache.conf 位于/etc/apache2/mods-availabe(enabled)下,
使用sudo a2enmod后,会自动创建disk_cache.conf/disk_cache.load的链接到enabled下:
有设置说明
# This path must be the same as the one in /etc/default/apache2
cacheroot
以下完整的默认文件:
还要看看网页的expries,last-modified,etag,cache-control,vary等应答及其设置。
使用sudo a2enmod后,会自动创建disk_cache.conf/disk_cache.load的链接到enabled下:
有设置说明
# This path must be the same as the one in /etc/default/apache2
cacheroot
以下完整的默认文件:
代码: 全选
<IfModule mod_disk_cache.c>
# cache cleaning is done by htcacheclean, which can be configured in
# /etc/default/apache2
#
# For further information, see the comments in that file,
# /usr/share/doc/apache2.2-common/README.Debian, and the htcacheclean(8)
# man page.
# This path must be the same as the one in /etc/default/apache2
CacheRoot /var/cache/apache2/mod_disk_cache
# Uncomment to enable caching of specified URLs using the disk
# storage manager.
#CacheEnable disk /
CacheDirLevels 5
CacheDirLength 3
</IfModule>
笔记
-------------------------------------
http://blog.163.com/wqt_1101
-------------------------------------
http://blog.163.com/wqt_1101