0

I am stucked now. Searched alot but never find answer.

I am using Apache + Nginx (reverse proxy) with Varnish v4

When i am trying to test varnish at isvarnishworking.com than on very first time i am getting (Yes! Sort of!) And when i referesh the page immediately only than i get (Yes!) After that when i don't referesh till 2 minutes than again i will get (Yes! Sort of!)

I think varnish is not serving the content from its cache. Some where something is wrong. Maybe the nginx.conf file or default.vcl

I tried to increase connection timeout in nginx.conf as well but no luck.

I tried to add no-cache in nginx as well but again no luck. Maybe i setup wrong.

Please guide me. Will be thankful. I never find answer of this problem. Maybe i missed something to see correctly from internet guides :(

Please help.

Thanx

zubair
  • 33
  • 1
  • 5

1 Answers1

0

The default time-to-live (ttl) for a cached object in varnish is 120 seconds (https://www.varnish-cache.org/docs/4.0/reference/varnishd.html#default-ttl).

The ttl for an object to be cached can be set in different ways:

  1. In the Cache-Control headers max-age (or s-maxage) of the backends response
  2. In the VCL configuration of you varnish
  3. Specifying the -t option of the "varnishd" process

Option 1 would be my first option and option 2 the second.

Ronald
  • 2,864
  • 3
  • 25
  • 36