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

feat: implement stale-while-revalidate for HTTP cache #6337

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

link2xt
Copy link
Collaborator

@link2xt link2xt commented Dec 12, 2024

No description provided.

@link2xt link2xt marked this pull request as draft December 12, 2024 11:33
@link2xt link2xt force-pushed the link2xt/http-stale-while-revalidate branch from 8c3fc6d to 3a5e3b9 Compare December 12, 2024 12:10
@link2xt link2xt marked this pull request as ready for review December 12, 2024 13:28
Copy link
Contributor

@hpk42 hpk42 left a comment

Choose a reason for hiding this comment

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

reads nicely!

@link2xt link2xt merged commit 2f976d8 into main Dec 12, 2024
37 checks passed
@link2xt link2xt deleted the link2xt/http-stale-while-revalidate branch December 12, 2024 14:30
// Update expiration timestamp
// to prevent deletion of the file still in use.
//
// We do not update stale timestamp here
Copy link
Collaborator

Choose a reason for hiding this comment

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

Still it makes sense to update stale to e.g. now + 1*minute to avoid revalidating very frequently (and have many parallel revalidation tasks) if revalidation fails or the HTTP request takes some time. The stale period is >= 1 hour, so 1 more minute won't be a problem

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

Successfully merging this pull request may close these issues.

3 participants