I am trying to detect user’s country based on their IP address and ability to change country as well. However with the use of Full Page Cache, country name is not getting display properly. Sometimes it displays random results.
I have tried to add cacheable=false to block XML file. But adding this would slow down entire page. Since this block is added to all pages, entire site getting slow by adding cacheable=false.
_isScopeprivate = true to my block PHP
__construct() function. But this is also not working.
Is there any way to exclude specific block from FPC without hurting site speed?
I have rewrite currency.phtml template for customize my goal,
<block class="Vendor\Module\Block\Currency" name="currency" template="Vendor_Module::currency.phtml" cacheable="false"/>
when i am keep cacheable=false in above block its working but page load time take so much time. So I want to remove cacheable="false" from above block.
Any suggestion would be appreciated. Thanks.