No cache: Varnish age 0

Irinel Iovan

Hy, i installed Varnish 4.0.3 on my webserver.

FreeBSD 10.2 amd64 apache24 php56 mysql56

Ok, all fine. All work's perfect.

But i have only one problem, i think varnish cache from cookies.

When i installed varnish , he don't created me any configuration files. Only in /usr/local/etc/rc.d/varnishd

This is in 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"

I configured after configuring all it's fine. But age is 0.

My question how to block cookie cache? I don't have a config file.. nothing.

http://www.isvarnishworking.com/ And this is my site: http://pvpgamers.net/

julp

Have you read Varnish documentation?

You can start your own configuration from builtin VCL. You can find them in /usr/local/share/doc/varnish/builtin.vcl (refer to pkg info -l varnish4 output if I'm wrong).

Then, add varnishd_config="/path/to/your/configuration" to /etc/rc.conf (and restart Varnish or reload your configuration).

My question how to block cookie cache?

Age: 0 means the page wasn't cached (miss). By default, Varnish doesn't cache when there is any cookie:

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

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related