views:

729

answers:

1

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.

+1  A: 

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.

Adam Davis
I figured the same. I was hoping someone had some experience with this question already and had maybe run some benchmarks or something. Thanks though.
Andrew