Quote:
|
Originally Posted by LegendaryLars
actually I think its a not being hit and cached issue. I am loading all these galleries up into our tgps sop they should speed up a lot soon.
|
Ahh, gotcha.
Just incase though, if you are not already doing so, you can store the low-high range for the city as integer and use this formula to get the user's IP in that format for quick query speed :
$ip = $_SERVER[REMOTE_ADDR];
$ip = split("\.",$ip);
$ip = (16777216 * $ip[0]) + (65536 * $ip[1]) + (256 * $ip[2]) + $ip[3];
This (in PHP) would make $ip a nice int you can use like so:
$sql = "SELECT city_id FROM city_ip WHERE $ip > city_ip_low AND $ip < city_ip_high";
If you use a high enough version of MySQL or Oracle, you could also save the above as a stored function/procedure for maximum speed
