Varnish4 cache not always working

Jaroslav huglester at gmail.com
Sun Nov 1 10:57:42 CET 2015


Hello,

I have successfully set up Varnish4 to cache the entire site for specific
time.

It is working with no problem.

Since these are our specific customers sites, we can safety remove headers
like 'Set-Cookie', "Vary', because those sites do not have user-login, only
backend.

The problem is that later we wanted to connect one more site, they return
near the same Headers, but one is not cached (the dynamic part). What is
cached is only the assets like css, js etc..

The only possible problem, we could spot, is that for example these are
response headers are different when we call the problematic site two times
in a row.:

```

HTTP/1.1 200 OK
Age: 0
Connection: keep-alive
Content-Encoding: gzip
Content-Length: 3354
Content-Type: text/html; charset=UTF-8
Date: Sun, 01 Nov 2015 09:45:18 GMT
Vary: Accept-Encoding
X-Cache-Hits: 0
X-Varnish-Cache: MISS


HTTP/1.1 200 OK
Age: 0
Connection: keep-alive
Content-Length: 0
Content-Type: text/html; charset=UTF-8
Date: Sun, 01 Nov 2015 09:45:33 GMT
X-Cache-Hits: 0
X-Varnish-Cache: MISS
```
As you can see, there are no 'Content-Encoding' headers, and
'Content-Length' is set to: 0
after I run the headers check for second time.
Maybe someone of you have ideas what I could  be wrong?

Thank you,
Jaroslav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20151101/0910dab2/attachment.html>


More information about the varnish-misc mailing list