1

I have Varnish 6.4 set up with Magento 2.4.2 in Kubernetes, and can confirm it is set up correctly by the "x-magento-cache-debug HIT" header. However, when I update a product, the product page isn't updating, presumably it is serving the cached old product page. Is there something I have to set up in Magento to get it to inform Varnish when a product etc has updated?

asked May 24, 2021 at 7:38

1 Answer 1

1

As per the official documentation, Varnish is purged automatically when you perform the below actions.

Maintaining a store (for example, adding or editing categories, prices, products, and promotional pricing rules).

I guess you missed the steps Configure Magento to purge Varnish . If you missed this step, Magento cache clean/flush will fail to purge the cache from varnish. Run the below command, it will configure Magento to purge the Varnish cache.

php bin/magento setup:config:set --http-cache-hosts=varnish-host:varnish-port

I hope it helps.

answered May 24, 2021 at 7:59
2
  • Thanks, I'll try that out. Commented May 24, 2021 at 8:26
  • Thanks, this helped. I had already used this command yesterday, but it turns out that my purge requests were 405ing due to my VCL configuration, which I worked out by using: varnishlog -g request -q 'ReqMethod eq "PURGE"' Commented May 25, 2021 at 1:06

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.