I had Varnish caching working for many months (staging environment), but just before launch I realised it is no longer caching any page.
- My thoughts -
I've generated a PHP file with randomised output. Unlike Magento pages, Varnish seems to cache this page just fine. Therefore I'm thinking this has something to do with the headers being set by Magento.
- Magento headers -
I have disabled Varnish for now, to look into the original headers being set by Magento. Below is a screenshot of the headers on a basic product page. I have no idea where to start looking. What could be causing Varnish not to cache the page?
- I've read something about Varnish not caching a page where cookies are being set. Seems like Magento is setting three different cookies on this page. Can this be the cause? How do I disable those cookies?
- Cache-Control mentions no-cache, no-store. Would be fine if those were Varnish headers to the client, but Magento passing this to Varnish instead doesn't look good to me?
I'm unsure what to do, because I know Varnish caching on Magento pages worked just fine before. I have no idea when exactly things stopped working, so I'm having a hard time tracking down the the cause of the issue.
- Nginx (SSL reverse proxy)