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

Can nuster support serve stale and update cache in background when cache is stale? #131

Open
everyx opened this issue May 8, 2024 · 0 comments

Comments

@everyx
Copy link

everyx commented May 8, 2024

from #96 (comment)

Let's say we have a cached response of request /test, which has a ttl of 100 seconds.

After 100 seconds, the cache is expired(assume no extend).

Suppose request A '/test' comes in at 101 seconds, another request B comes in at 102 seconds, and request C comes in at 110 seconds. (Assume backend needs 5 seconds to handle the request)
...
2. use use-stale on
A will be forwarded to backend and the cache will be updated.
B will be served use the stale cache
C will be served use the new cache

I want A to use stale cache like B until the cache is updated, how do I configure this?

Background
In my usage scenario, visitors do not have very high requirements for the immediacy of web page updates, that is to say, the stale content can be served, but at this time when cache expires the cache server should update the cache in time, and provide stale before this, just like varnish does when ttl < 0 and stale > 0, but varnish doesn’t support persistence well which nuster does.

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

No branches or pull requests

1 participant