没有缓存:清漆0岁

时间:2015-09-26 23:41:16

标签: varnish

Hy,我在我的网络服务器上安装了Varnish 4.0.3。

FreeBSD 10.2 amd64 apache24 php56 mysql56

好的,一切都很好。 所有工作都很完美。

但我只有一个问题,我认为来自cookies的清漆缓存。

当我安装清漆时,他没有创建任何配置文件。 仅限于/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
	: ${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
	: ${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/

1 个答案:

答案 0 :(得分: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表示页面未缓存(未命中)。默认情况下,Varnish在有任何cookie时不会缓存:

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