Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TTL support? #31

Closed
bookmoons opened this issue Jun 5, 2019 · 6 comments · Fixed by #32
Closed

Add TTL support? #31

bookmoons opened this issue Jun 5, 2019 · 6 comments · Fixed by #32

Comments

@bookmoons
Copy link
Contributor

I'm evaluating this for possible use in another project. It seems to be the nicest resolver available, but I need something with an expiring cache that respects TTL.

Would the team consider a PR to support TTL?

@bookmoons
Copy link
Contributor Author

@ydnar @case Sorry for the ping guys. Wasn't sure if the issue will be seen. I'm inclined to write a patch for this but wanted to ask first if getting it in is a possibility.

@cee-dub
Copy link
Member

cee-dub commented Jun 6, 2019

Thanks for proposing this. Would you tell us a bit about the design you have in mind to add the feature?

@bookmoons
Copy link
Contributor Author

Thanks for looking at it. I've looked over it a little. The underlying miekg/dns exposes TTL. There's a cache built around this RR struct. It's a benefit this is already structured data, I was looking at other caches but they all store string values.

TTL can be stored in this record when retrieved. Cache reads can then verify liveness and only return if the entry is live. That happens here so an expired entry would trigger a standard query to DNS again.

I'd make it optional so when it's disabled you're not storing TTLs unnecessarily.

@cee-dub
Copy link
Member

cee-dub commented Jun 7, 2019

Will definitely look at a PR. If you can share your use case, that will help us with context, too. Thanks!

@bookmoons
Copy link
Contributor Author

Wonderful.

@bookmoons
Copy link
Contributor Author

Made a submission #32 to start this off.

@ydnar ydnar closed this as completed in #32 Jun 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants