When a request is received where cache retrieval is specified,
the following takes place:
- Attempt to retrieve this entry from the cache. If unsuccessful,
issue the GETHOSTBYNAME call unless request specifies cache only.
- If cache retrieval is successful, calculate the age of the record.
This is the difference between the current time and the time this
record was created or refreshed.
- If the age is not greater than minimum cache refresh, use the
cache information and build the Hostent structure for the requestor.
Then return to the requestor.
- If the age is greater than the maximum cache refresh, issue the
GETHOSTBYNAME call and refresh the cache record with the results.
- If the age is between the minimum and maximum cache refresh values,
do the following:
- Calculate the difference between the maximum and minimum cache
refresh times and divide it by the maximum number of concurrent resolver
requests. The result is called the time increment.
- Multiply the time increment by the number of currently active
resolver requests. Add this time to the minimum refresh time giving
the adjusted refresh time.
- If the age of the record is less than the adjusted refresh time,
use the cache record.
- If the age of the record is greater than the adjusted refresh
time, issue the GETHOSTBYNAME call and refresh the cache record with
the results.
- If the GETHOSTBYNAME is issued and is successful, the cache is
updated and the update time for the entry is changed to the current
time.