httpgeolocationhttp-accept-language

Accuracy of accept_language to detect country


I need to detect the country of users but I'm trying to avoid the whole call to an external service to get the location based on IP or to an internal database. I need to make this service really responsive and it takes almost half a second to query any external service so I'm trying to avoid that. Also any call to a db would be costly for this approach. I need the page to respond in less than 20ms.

I'm thinking of get the country locale based on Accept_language header.

My question is. Does anyone know how accurate may this be? I'm aware country is not always present or users may change default language or be present on a different country with their computers.

Does anyone had previous experience or is there any documentation (I couldn't find one googling or in w3 page) that specifies a percent of accuracy or error using this approach?


Solution