Currently location information is stored in a global variable, $HostipLookupResultSet. This means data must be fetched from hostip for every page load. Instead, the data should be stored in the session and refreshed only if missing.

This data should also be in a hook implementation rather than directly called in the .module code. Proposed approach:


function hostip_init() {
  if (empty($_SESSION['hostip_data'])) {
    $_SESSION['hostip_data'] = _hostip_get_iptocountry_info();
  }
}

Comments

amitgoyal’s picture

Assigned: Unassigned » amitgoyal
Status: Active » Closed (fixed)

Thanks for the suggestion, Nedjo. We have incorporated the changes in D6 and D7 versions. D5 version is no longer supported.