2015-09-26 48 views
0

Hy,我在我的网络服务器上安装了Varnish 4.0.3。没有缓存:清漆年龄0

FreeBSD的10.2 AMD64 apache24 php56 mysql56

好了,所有的罚款。 所有的作品都很完美。

但我只有一个问题,我认为从缓存饼干清漆。

当我安装了清漆时,他没有创建任何配置文件。 只有在/usr/local/etc/rc.d/varnishd

这是varnishd:

. /etc/rc.subr 
 

 
name=varnishd 
 
rcvar=varnishd_enable 
 

 
load_rc_config ${name} 
 

 
: ${varnishd_enable:=YES} 
 
: ${varnishd_pidfile=/var/run/${name}.pid} 
 
: ${varnishd_listen=:80} 
 
: ${varnishd_admin=localhost:81} 
 
: ${varnishd_backend=127.0.0.1:8080} 
 
: ${varnishd_storage=file,/tmp,100M} 
 
: ${varnishd_hash=classic,16383} 
 
: ${varnishd_user=www} 
 
: ${varnishd_group=www} 
 

 
command="/usr/local/sbin/${name}" 
 
pidfile="${varnishd_pidfile}" 
 

 
if [ -n "${varnishd_config}" ] ; then 
 
\t : ${varnishd_flags:="-P ${varnishd_pidfile} -a ${varnishd_listen} -T ${varnishd_admin} -f ${varnishd_config} -s ${varnishd_storage} -h ${varnishd_hash} -u ${varnishd_user} -g ${varnishd_group} ${varnishd_extra_flags}"} 
 
else 
 
\t : ${varnishd_flags:="-P ${varnishd_pidfile} -a ${varnishd_listen} -T ${varnishd_admin} -b ${varnishd_backend} -s ${varnishd_storage} -h ${varnishd_hash} -u ${varnishd_user} -g ${varnishd_group} ${varnishd_extra_flags}"} 
 
fi 
 

 
unset varnishd_user 
 
unset varnishd_group 
 

 
run_rc_command "$1"

我配置所有它的罚款后配置。 但年龄为0.

我的问题如何阻止cookie缓存?我没有配置文件..什么都没有。

http://www.isvarnishworking.com/ 这是我的网站:http://pvpgamers.net/

回答

0

你读过Varnish documentation

你可以从内建的VCL开始你自己的配置。你可以在/usr/local/share/doc/varnish/builtin.vcl找到它们(如果我错了,请参考pkg info -l varnish4输出)。

然后,将varnishd_config="/path/to/your/configuration"添加到/etc/rc.conf(并重新启动Varnish或重新加载您的配置)。

我的问题如何阻止cookie缓存?

年龄:0表示页面未被缓存(未命中)。默认情况下,当有任何Cookie时,Varnish不会缓存:

if (req.http.Authorization || req.http.Cookie) { 
    /* Not cacheable by default */ 
    return (pass); 
}