Pregunta

It's from the same page. When I first load the page, it's "MISS" if I refresh the page it will "HIT"

If I go back to my website home page and come back to the same page again it's "MISS" I refresh the page and its "HIT"

Do you know why varnish is behave like that? I'm using varnish 3

Thanks for your help guys.

HIT

Accept-Ranges:bytes
Age:61
Cache-Control:public, max-age=3600
Connection:keep-alive
Content-Encoding:gzip
Content-Language:en
Content-Type:text/html; charset=utf-8
Date:Wed, 18 Oct 2017 01:14:40 GMT
Etag:"1508289218-0"
Last-Modified:Wed, 18 Oct 2017 01:13:38 GMT
Server:Apache
Vary:Accept-Encoding
Via:1.1 varnish
X-Content-Type-Options:nosniff
X-Drupal-Cache:MISS
X-Frame-Options:SAMEORIGIN
X-Generator:Drupal 7 (http://drupal.org)
X-UA-Compatible:IE=edge,chrome=1
X-Varnish:83548823 83548200
X-Varnish-Cache:HIT

MISS

Accept-Ranges:bytes
Age:0
Cache-Control:public, max-age=3600
Connection:keep-alive
Content-Encoding:gzip
Content-Language:en
Content-Length:22462
Content-Type:text/html; charset=utf-8
Date:Wed, 18 Oct 2017 01:13:39 GMT
Etag:"1508289218-0"
Last-Modified:Wed, 18 Oct 2017 01:13:38 GMT
Server:Apache
Vary:Accept-Encoding
Via:1.1 varnish
X-Content-Type-Options:nosniff
X-Drupal-Cache:MISS
X-Frame-Options:SAMEORIGIN
X-Generator:Drupal 7 (http://drupal.org)
X-UA-Compatible:IE=edge,chrome=1
X-Varnish:83548200
X-Varnish-Cache:MISS
¿Fue útil?

Solución

What you describe really looks like cache expiration. Note that the default TTL for cache in Varnish is 120 seconds only.

You would need to adjust Varnish TTL to something higher, obviously.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a drupal.stackexchange
scroll top