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

add keepalive option #17

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

tangxinfa
Copy link
Contributor

@tangxinfa tangxinfa commented Nov 24, 2016

Unlike ttl, if cached item expired by keepalive, it return the cached value, and make asynchronously dns request for update the cache.

@yahoocla
Copy link

Thank you for submitting this pull request, however I do not see a valid CLA on file for you. Before we can merge this request please visit https://yahoocla.herokuapp.com/ and agree to the terms. Thanks! 😄

@yahoocla
Copy link

CLA is valid!

@tangxinfa
Copy link
Contributor Author

Already aggreed, please check again.

@drewfish
Copy link
Contributor

I like the idea, but the "keepalive" name is confusing to me. Squid (an HTTP proxy) calls this "stale while revalidate" though that's too long for us here :) Perhaps "useStale" instead?

parallel call dns methods for speedup test.
}
} catch (e) {
if (staleCallback) {
staleCallback();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be saying "if an exception is thrown mark the cache entry as not stale", does that make sense?

@drewfish
Copy link
Contributor

It might be worthwhile to mention the useStale callback in the "advanced caching" section in README.md.

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.

3 participants