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

Add SWR threshold capability #2

Open
wants to merge 1 commit into
base: add-smart-lifetime
Choose a base branch
from
Open

Conversation

rmccue
Copy link
Member

@rmccue rmccue commented Feb 18, 2025

This will work automatically with Batcache, as it only instructs CloudFront to change its behaviour, rather than everything.

stale-while-revalidate time is basically added to max-age, so if max-age is 600 and swr is 60, the item will last in CloudFront for 660 seconds.

I picked 30/60s here as thresholds; it's diminishing returns past that. It shouldn't take more than 30s to regenerate a request anyway, so for frequently accessed data, it should basically always be served from the cache now.

This will work automatically with Batcache, as it only instructs
CloudFront to change its behaviour, rather than everything.
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.

1 participant