bcosca / fatfree

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GEO plugin timeout

Jonett opened this issue · comments

commented

my code:
$geo = \Web\Geo::instance();
$loc = $geo->location();
var_dump($loc);

http://www.geoplugin.net/json.gp
might be the issue here blocking the requests.

commented

as per Acceptable Use Policy, your IP may may be blocked forever

Greater than 120 API requests per minute will get you blacklisted for 1 hour, during which time you will receive a "403 Forbidden" response.
More than 1500 requests per minute will get you blocked permanently at the firewall meaning the server will not reply at all. If your IP is blocked by the firewall, a premium subscription is required to remove the block. In this case, you need to contact us once you've subscribed with your IP so we can manually remove the firewall block.

commented

I wasn't able to complete even 1 request. It timed out on first try, i tested it out on another server with same results.

@Jonett I ran your code snippet from my server and it worked w/o issue.

I can think of 2 possible scenarios causing your current issue.

  1. You're on a shared server and someone else already violated the API limits and they blocked the server IP.

  2. This one is a little harder to explain, but I've seen it happen numerous times, and it's not visually apparent unless view and watch the console while the code loads.

If you're using an htaccess file loading dynamic URLs and loading assets like CSS, images and etc in a common theme file, and some of those assets are not loading properly, it can create a loop loading 404 pages.

For example: You request a URL, and let's say that a CSS file can't load, so in place of the CSS, the server triggers a 404 error. Your code loads the same template to render the 404, which also includes that same CSS file, and the server returns a 404 error for that request. I've seen this process repeat to the point where the server stops responding all together, or eventually stops responding to the requesting IP.

Hope this helps.

commented

@geniuswebtools, im guessing the option 1. as I dont load any templates during the request. Thanks for testing it out as well.