so far i guess the best approach would:
1) when a visitor comes, check his IP
2) check whether this IP is already in your database
2a) if not, do whois and parse country from the response string. add this IP+country to the database so you will be able to find it next time, without doing whois.
2b) if this IP was already in your database, then just read the corresponding country.
this way you will soon have lots of IP's in the database but that is why we have databases, right :-)
note that "whois" takes some time... maybe its better to have a cronjob to go through unknown IP's while you are only inserting them to the database... i dont know.
any better ideas? if someone wrote something yet, let me know.