的MaxMind地理位置API:阿帕奇与PHP [英] Maxmind geolocation apis: Apache vs PHP

查看:163
本文介绍了的MaxMind地理位置API:阿帕奇与PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我期待实现一个非常基本的国家限制在我的网站基础上,的MaxMind的GeoIP数据库(免费版)。基本上,我想该网站的所有用户限制到只有一个国家。我想知道的是:是否有使用的Apache API 兑任何性能增益< A HREF =htt​​p://www.maxmind.com/app/php相对=nofollow> PHP API ?

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?

我希望能够使用该国code,不仅仅是一个简单的重定向(在不同的语言显示信息等)较多,所以这就是为什么我倾向于PHP,但我的头号关注的是对性能的影响。

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.

感谢您的任何建议。

推荐答案

与Apache API的主要优点是,PHP是永远不会被调用(除非你然后重定向到一个PHP页面)。

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.

这篇关于的MaxMind地理位置API:阿帕奇与PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆