disk_cache 怎么没用,看看哪里错了

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
头像
cloudor
帖子: 23
注册时间: 2009-08-04 21:43

disk_cache 怎么没用,看看哪里错了

#1

帖子 cloudor » 2009-08-08 12:47

$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下没有缓存内容,是怎么回事?

lifefre.com
lmg435
帖子: 1
注册时间: 2009-07-31 8:59

Re: disk_cache 怎么没用,看看哪里错了

#2

帖子 lmg435 » 2010-03-11 11:36

我也有这种问题,怎么没有人回答啊,还请高手指点一下哈!
头像
link_01
帖子: 1024
注册时间: 2008-11-05 13:24

Re: disk_cache 怎么没用,看看哪里错了

#3

帖子 link_01 » 2010-03-11 11:49

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

以下完整的默认文件:

代码: 全选

<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>
还要看看网页的expries,last-modified,etag,cache-control,vary等应答及其设置。
笔记
-------------------------------------
http://blog.163.com/wqt_1101
回复