allBlogsList

First Time Geo IP Data Missing

Recently I had a client who reported problems with the geo ip service data with Sitecore 7.2.  They use the information returned, specifically your country, to determine if you need to be redirected to a new site.  But in some situations a user would not see that redirection occur until the next page load.

I dug through the geo ip call that Sitecore makes and came up with some interesting discoveries.  First stop is the cache.  If no data is found there is a thread started to check the database for information then to go to the service look up assuming that the setting Analytics.PerformLookup is set to true.  If data is found this way it is passed back to the cache, which is reviewed a second time.

The problem is that there is really no wait involved to see if this thread returns data.  So I contacted Sitecore support to see if they had heard of this.  They immediately had a response and directed me to this article:  https://kb.sitecore.net/articles/320734 .

Solution 1 is a real simple fix.  One dll and one config file.  Upon reviewing the dll I found that the fix was to add in a delay.  The delay (milliseconds) is not a 100% solution, you could still have connectivity that slows you down beyond the delay, but in my opinion it gives that first time geo ip a real fighting chance.

You also have to take into consideration of what is an acceptable delay for your user to wait.  Adding a couple second wait on the load of a website can generally be rather undesirable.  In that case Solution 2 might be more suitable.  However like anything locally hosted you now are responsible for managing it.  No longer do you have that real time data updates.