繁体   English   中英

无缓存:清漆年龄0

[英]No cache: Varnish age 0

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

FreeBSD 10.2 amd64 apache24 php56 mysql56

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

但是我只有一个问题,我认为cookie中的清漆缓存。

当我安装varnish时,他没有为我创建任何配置文件。 仅在/usr/local/etc/rc.d/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/

您阅读过Varnish文档吗?

您可以从内置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);
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM