Cache System
Overview
We run an extensive caching system and will store results received from all telephone networks for 30 days.
For each telephone number you process you can optionally choose to use the cache or not use the cache.
Benefits
Latency
This is significantly reduced if a result is retrieved from the cache. This is especially useful if processing large volumes or where low latency is valuable - for example when routing telephone calls (to reduce PDD) or SMS messages.
Costs
Any results retrieved from the personal cache are returned for free. Any results returned from global cache are charged at ½ a credit cost.
Free Credits
Most clients allow their responses to be retrievable by other users checking the same telephone number in the future. Each retrieval from the Global Cache earns the original checker ¼ credit.
Admin Time
You do not need to deduplicate data as you can retrieve your previous results for free up to 30 days.
Levels of caching
Private cache
Results from telephone networks where the account requesting this lookup made the previous lookup.
Global cache
From telephone networks where the account requesting this lookup did not make the previous lookup and the account which made the previous lookup flagged the result as being retrievable globally.
Clients can decide if they would like to include the results they receive from the telephone networks to be retrievable from the cache by implementing the save_to_cache feature.
Processing order
If the request includes a number of days using the cache_days_private setting, then the Private Cache is checked first, if a result is obtained by looking back the number of days specified then processing is stopped and this result is returned for free. If multiple results are found in the cache then the newest result will be used.
If the request includes a number of days using the cache_days_global setting, then the global cache is checked. If a result is obtained by looking back the number of days specified then processing is stopped and this result is returned for the cost of ½ a credit. If multiple results are found in the cache then the newest result will be used. The account which originally requested the lookup to be performed for this result will receive ¼ credit.
If no result is found in the cache, or 0 days were set for cache retrieval, then the request is sent to the telephone network and charged as normal.
Curl Example Using Optional Cache Parameters
curl -H "Content-Type: application/json" -X POST -d `{"api_key": "your_api_key_here", "api_secret": "your_api_secret_here", "requests": [{"telephone_number": "441133910781", "cache_days_private": 30, "cache_days_global": 15, "save_to_cache": "YES"}]}`
https://api.hlrlookup.com/apiv2/hlr