Maxmind 地理定位 API:Apache 与 PHP [英] Maxmind geolocation apis: Apache vs PHP

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

问题描述

我希望基于 Maxmind geoip 数据库在我的网站上实施一个非常基本的国家/地区限制(免费版).基本上,我想将网站的所有用户限制在一个国家/地区.我想知道的是:使用 Apache APIPHP 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?

我希望能够将国家/地区代码不仅仅用于简单的重定向(显示不同语言的消息等),这就是我倾向于 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:Apache 与 PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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