I'm having a problem with the currency and the cache. I'm using Magento ver. 2.2.5 with Redis and Varnish.
Here are the steps to reproduce...
- Go to homepage
- Go to some PLP
- Change the currency
- Go to the homepage again (by clicking the logo)
The currency must be the selected one in the step 3
The currency is the same than step 1
Note: When I go to the home page by clicking the logo, the issue happens. But if I press F5 it works fine.
Then, I try to find the difference between clicking the logo and made an F5 refresh. I can see a difference in the request. When I click the logo I can see this request header.
But when I do an F5 refresh I can see this request header.
I can solve this by adding this header on the server response.
$resultPage->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0', true);
But I think that's wrong. I mean, I'm disabling cache right?.
If somebody have an idea it will be appreciated! Thanks