Skip to content
This repository was archived by the owner on Feb 13, 2021. It is now read-only.
This repository was archived by the owner on Feb 13, 2021. It is now read-only.

Unable to clear cache #24

@mirajshah05

Description

@mirajshah05

Let's say I cache all the results for an hour. What would happen if you get a bad hostname that the library is not able to resolve for a minute but is available later. Would the bad result be cached for an hour?
Example:
Default config:
dnscache = require('dnscache')({
"enable" : true,
"ttl" : 3600,
"cachesize" : 1000
});
Time 0: Hostname - cannot be resolved
dnscache.lookup(hostname ..) => err (would the bad host be cached?)
Time 5: Hostname - all up and ready to be resolved
dnscache.lookup(hostname ..) => ? (would it pick up from the cache?)

If there is a way you could provide to clean up the cache

If you could add more documentation regarding the use of this library it would be appreciated. Like to return the value we need a callback or a promise based interface. The function is async ..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions