Varnish can not cache my site

My site is at https://www.stockmaniacs.net. Its hosted in Dreamhost Dreampress plan. I activated flexible SSL in CF. After that I have installed Cloudflare Flexible SSL plugin in wordepress. Now, I noticed that my varnish is not caching. When I contacted the dreamhost team they told me to contact cloudflare. Below are there response.

200: OK
date: Wed, 19 Jun 2019 14:35:24 GMT
content-type: text/html; charset=UTF-8
transfer-encoding: chunked
connection: close
set-cookie: __cfduid=d9754ef3cd752755d3eb5c64ae9aff63e1560954924; expires=Thu, 18-Jun-20 14:35:24 GMT; path=/; domain=.stockmaniacs. net; HttpOnly; Secure
link: ; rel=“api. w. org/”
x-cacheable: YES:Forced <------------------ This indicates that irregardless of what isvarnishworking.uk is displaying, that the server cache is working properly

accept-ranges: bytes
x-varnish: 962993774 962993771
expect-ct: max-age=604800, report-uri=“report-uri.cloudflare. com / cdn-cgi/beacon/expect-ct”
server: cloudflare <------- This is indicating that Cloudflare is detecting Varnish not working, so you would want to contact them for further information.
cf-ray: 4e963ab5fe066c8c-SJC

Can anyone help me please?

Indrajit

They made this up. The server header is meaningless.

The value of x-cachable is defined in your VCL, but YES:Forced in many recipes means that the backend send a TTL lower than 300s.

Why do you think Varnish is not caching your site? Do you have an example URL that is not being cached in Varnish when it should be?

1 Like

Hi, I checked the homepage with isvarnishworking.uk

The response I got is like the following.

301: Moved Permanently
server: Apache
location: http://www.stockmaniacs. net/
vary: Accept-Encoding
content-type: text/html; charset=iso-8859-1
x-cacheable: YES:Forced
transfer-encoding: chunked
date: Thu, 20 Jun 2019 04:36:20 GMT
x-varnish: 963032172 963031995
age: 186
connection: close

301: Moved Permanently
date: Thu, 20 Jun 2019 04:36:20 GMT
transfer-encoding: chunked
connection: close
cache-control: max-age=3600
expires: Thu, 20 Jun 2019 05:36:20 GMT
location: https://www.stockmaniacs. net/
server: cloudflare
cf-ray: 4e9b0a8a2a20d0dc-SJC

200: OK
date: Thu, 20 Jun 2019 04:36:22 GMT
content-type: text/html; charset=UTF-8
transfer-encoding: chunked
connection: close
set-cookie: __cfduid=d827586ab2609469644e223b6f74200c21561005380; expires=Fri, 19-Jun-20 04:36:20 GMT; path=/; domain=.stockmaniacs. net; HttpOnly; Secure
link: ; rel=“https://api.w. org/”, ; rel=shortlink
cache-control: private, proxy-revalidate, s-maxage=0
x-cacheable: NO:Not Cacheable
accept-ranges: bytes
x-varnish: 963032173
expect-ct: max-age=604800, report-uri=“https://report-uri.cloudflare. com/cdn-cgi/beacon/expect-ct”
server: cloudflare
cf-ray: 4e9b0a8a4fc2d0e4-SJC

This topic was automatically closed after 30 days. New replies are no longer allowed.