Php – Maxmind geolocation apis: Apache vs PHP


I am looking to implement a very basic country limiting on my site based on the Maxmind geoip database (free version). Basically, I want to limit all users of the site to one country only. What I'm wondering is: is there any performance gain using the Apache API versus the PHP API?

I want to be able to use the country code for more than just a simple redirect (display messages in different languages, etc.), so that's why I'm leaning toward PHP, but my number one concern is the impact on performance.

Thanks for any advice.

Best Solution

The main advantage with the apache API is that PHP is never invoked (unless you then redirect to a PHP page).

So the decision is made sooner, and you have more control over whether it affects your performance or not.

Other than that, there's not too much difference.