magefan / module-geoip

Detect Country by IP in Magento 2
Open Software License 3.0
52 stars 10 forks source link

Varnish support #6

Closed Tjitse-E closed 5 years ago

Tjitse-E commented 5 years ago

Does this module work with Varnish caching enabled?

magefan commented 5 years ago

@Tjitse-E , thank you for your question. This module is not a self-sufficient module, it is pease of code that works with different GeoIp databases and provides the functionality to define visitor country based on the IP (GeoLocation). If you want to get an answer I this module works with Varnish, the answer depends on how you will use it.

We use magefan/module-geoip in these our modules

  1. Magento 2 Auto Currency Switcher Extension
  2. Magento 2 Auto Language Switcher Extension

both of these auto-switcher extensions compatible (work) with varnish.

Let us know if you have any other questions.

Tjitse-E commented 5 years ago

Hi @magefan.

We've created a auto country select module on top of Magefan GeoIP. I'll test in the coming weeks if it will work with Varnish.

Thanks for the module so far!

magefan commented 5 years ago

@Tjitse-E , We have checked the code of your module (vendic/magento2-geoip-country-preselect), and it will have an issue with Magento Page Cache and will not work properly with varnish. We recommend to use Magento 2 Auto Currency Switcher by Magefan. It already does what you trying to achieve, and works perfectly with Magento build in Page Cache and Varnish, it will allow you to save time and money.