-
Notifications
You must be signed in to change notification settings - Fork 39
add keepalive option #17
base: master
Are you sure you want to change the base?
Conversation
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! 😄 |
CLA is valid! |
Already aggreed, please check again. |
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? |
ebb9706
to
601ed48
Compare
601ed48
to
21ea7a7
Compare
parallel call dns methods for speedup test.
} | ||
} catch (e) { | ||
if (staleCallback) { | ||
staleCallback(); |
There was a problem hiding this comment.
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?
It might be worthwhile to mention the useStale callback in the "advanced caching" section in README.md. |
Unlike
ttl
, if cached item expired bykeepalive
, it return the cached value, and make asynchronously dns request for update the cache.