PROBLEM: Currency switch doesn't affect home page
My website has 2 currencies: USD/CAD
I have configured currency rates. Add Fixer.IO key.
When I try to change currency on home page it doesn't changes. But when I go to other route all work well.
Tried to clear cache, but it doesn't get work
Home page(product and current currency):
Solved! Go to Solution.
Solved by setting cache_lifetime to null for block
Hello @ussorawayf4404
You need to set cache life time of block and widgets. Kindly refer below code reference:
<type name="MyBlock"> <arguments> <argument name="data" xsi:type="array"> <item name="cache_lifetime" xsi:type="number">3600</item> </argument> </arguments> </type>
It may help you!
Thank you
my block is:
{{block class="Magento\\Cms\\Block\\Block" block_id="id1-block2" cacheable="false"}}
Hello @ussorawayf4404
"Cachable" = false also work but in this case, complete page cache will collapse and page load speed will increase.
You can also refer below steps:
1. On the admin sidebar 2. Go to Stores > Configuration > Advanced > System > Full Page Cache. 3. In the caching Application field, select one of the following Built-in Application Varnish Caching 4. In the TTL (time to live) for the public content field set the time-out for the page cache. The default value is 86400.
It may help you.
Thank you
My homepage has next content (Content -> Pages -> Home)
Cache in system: