Skip to content
This repository has been archived by the owner on Feb 3, 2024. It is now read-only.

Add an opportunity to specify max cache age #256

Merged
merged 1 commit into from
Jan 24, 2023

Conversation

sorrowless
Copy link
Contributor

If one have a case to use this library in an external tooling (e.g. monitoring solutions), it would be nice to allow changing maximum cache age. Such an option will allow to not reimplement own caches solution in such an external tooling and also reduce default 2 days cache age to provide changed domain info faster.

To do this, introduce additional option cache_age in do_query function.

If one have a case to use this library in an external tooling (e.g.
monitoring solutions), it would be nice to allow changing maximum cache
age. Such an option will allow to not reimplement own caches solution in
such an external tooling and also reduce default 2 days cache age to
provide changed domain info faster.

To do this, introduce additional option `cache_age` in do_query
function.
@maarten-boot
Copy link
Collaborator

yes nice idea,
note that you may also have to use the -f option on the cli whois that exists on linux to switch of using the whois cache, not sure how long that cache retains data.
not sure if that option actually exists for Mac and Windows though (i have no mac and normally dont use windows myself to develop)

@DannyCork
Copy link
Collaborator

on Mac
-f Use the African Network Information Centre (AfriNIC) database.
It contains network numbers used in Africa and the islands of the
western Indian Ocean. Get query syntax documentation using whois
-f help

@maarten-boot
Copy link
Collaborator

on linux (fedora using whois/jwhois )

       -f --force-lookup
              forces a query to be made to a host even if a current object is available from the cache.

unfortunately it does not specify how long the cache time is for whois

if we would want to suppress caching by whois itself
we may have to add multi platform awareness (linux, mac, windows)
and even distribution awareness (ubu, fedora, rocky) if they use different whois packages

for now lets pass on the caching of whois itself and assume it is shorter then our own caching
we can tackle it when it becomes relevant ,
i mentioned it only so we are aware there is another caching by default in most whois implementations

@maarten-boot
Copy link
Collaborator

i suggest to accept the current pull request as is, it is a useful addition

@DannyCork DannyCork merged commit eceae65 into mboot-github:master Jan 24, 2023
@sorrowless sorrowless deleted the feat/cache-age branch January 27, 2023 16:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants