I have a 4.9.6 wordpress site hosted on pantheon. I am trying to leverage there varnish cache feature provided by pantheon but I am running into problems with a cookie being set site-wide for anon users that is not allowing my site to cache. When I run
curl -I dev-example.pantheonsite.io in terminal the output is
HTTP/1.1 200 OK
Cache-Control: public, max-age=3600
Content-Type: text/html; charset=UTF-8
Link: <http://dev-example.pantheonsite.io/wp-json/>; rel="https://api.w.org/"
Link: <https://example.me/xxxxx>; rel=shortlink
Server: nginx
Set-Cookie: SESS493517e45081d627fb825d332c442179=6598ca6c993e2d779127efcc27c022e6; path=/; domain=.dev-example.pantheonsite.io; HttpOnly
X-Pantheon-Styx-Hostname: styx-fe1-a-74cb6bb89d-mzdm6
X-Styx-Req-Id: styx-1cd2c5b9a35cd4232543231dd5bb1736
Via: 1.1 varnish
Transfer-Encoding: chunked
Accept-Ranges: bytes
Date: Wed, 30 May 2018 21:11:56 GMT
Via: 1.1 varnish
Age: 0
Connection: keep-alive
X-Served-By: cache-mdw17350-MDW, cache-dfw18628-DFW
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1527714713.844595,VS0,VE3179
Vary: Accept-Encoding, Cookie, Cookie
X-Robots-Tag: noindex
After I disable the woocomerce plugin the cookie is gone and page caching works. The only help I have found from google is adjusting my varnish settings which can not be done by me on pantheon. Any other ideas/work around? I have gone back and forth with pantheons customer support and they told me I need to come up with a solution. Surely people are running woo on pantheon and are able to leverage varnish.
PS You can probably tell I am new to varnish :)
Woocommerce has a resource specifically for this problem.
https://docs.woocommerce.com/document/configuring-caching-plugins/#section-5
<-- EDIT -->
I realise that it's all to do with configuring varnish, not Wordpress, but what needs to be understood here is that the fix can't be done from the Wordpress/WC end of things. Varnish needs to be configured so that it passes through woocommerce pages.