Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Allow passing configurable minimumCacheTime through to dns-cached-resolve #35

Closed
sandinmyjoints opened this issue Nov 6, 2019 · 4 comments · May be fixed by vercel/dns-cached-resolve#24

Comments

@sandinmyjoints
Copy link

sandinmyjoints commented Nov 6, 2019

https://github.com/zeit/dns-cached-resolve/ defaults to 300s, which could be problematic with records with lower ttls. For example, AWS ELBs always use 60s.

This would require a change to https://github.com/zeit/fetch-cached-dns/ as well, I believe.

@OlliV
Copy link
Contributor

OlliV commented Nov 7, 2019

An alternative way to cope with it could be to invalidate the cached IP in case it doesn't work anymore. It's quite a lost battle but https://00f.net/2019/11/03/stop-using-low-dns-ttls/

Since we are again facing the same issue that a change in multiple repos is needed, I'm again proposing monorepoizing @zeit/fetch.

@sandinmyjoints
Copy link
Author

sandinmyjoints commented Nov 8, 2019

Is it possible to invalidate it from this lib as-is, or are you offering that as an alternate approach to take going forward? It sounds fine to me--would solve for our use case.

I've read that article too, but AWS ¯\(ツ)

@OlliV
Copy link
Contributor

OlliV commented Nov 12, 2019

It's theoretically possible. IIRC, you can register an error handler with @zeit/fetch and then you might be able to dig your way into the dns resolver and ask it to refresh in the error handler: https://github.com/zeit/dns-cached-resolve/blob/master/src/dns-resolve.ts#L14

So what I mean is that an alternative could be to implement an automatic DNS refresh in case of a network error.

However, I think it would be a good idea to implement your original proposal as well.

@Ethan-Arrowood
Copy link
Contributor

Thank you for the report. We are archiving this project; you can read more details here: #83

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 a pull request may close this issue.

3 participants