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

add keepalive option#17

Open
tangxinfa wants to merge 3 commits intoyahoo:masterfrom
tangxinfa:feature-keepalive
Open

add keepalive option#17
tangxinfa wants to merge 3 commits intoyahoo:masterfrom
tangxinfa:feature-keepalive

Conversation

@tangxinfa
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown

CLA is valid!

@tangxinfa
Copy link
Copy Markdown
Contributor Author

Already aggreed, please check again.

@drewfish
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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