Re: Manuals and Spiders

From: Date: Wed, 23 Apr 2003 14:12:06 +0000
Subject: Re: Manuals and Spiders
References: 1  Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-16947@lists.php.net to get a copy of this message
I guess then the only alternative that we are left is some sort of faster text search, by splitting the file, or using byte offsets, and then storing the country info in the cookie so that only one lookup is required per visitor. I will continue my search for any better solns any ways. Meanwhile, do let me know if you need any inputs from my end, if we want to start with the existing soln. The db is freely downloadable from the website.
I think it would be doable to request the database from your server from time to time with a cronned PHP script. Then it can do any "fixing" in case you won't provide us exactly what is suitable... Every piece of our current system works with three letter country codes for example (mirror images, mirror country specs). So IMHO it would be the best to have this list with three letter codes, instead of two letter ones. Staying with the textfile based model, it would probably be the best to have fixed width fields (IP numbers padded with zeros at the left), so we can build up a small index to help seek in the file. Then there won't be any need to have more then one data file. The index would help us seek near to the place where the IP info is stored, so we only need to check some IP ranges there, near to the IP... This may lead to a significantly bigger file because of the padding zeros and the three letter country codes, but we can leave out the commas in this case (and the country name is definitely not needed as we have a mapping array for this: http://www.php.net/include/countries.inc ) Goba

« previous php.mirrors (#16947) next »