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: stale-while-revalidate #416

Merged
merged 2 commits into from
Jan 17, 2024
Merged

Feat: stale-while-revalidate #416

merged 2 commits into from
Jan 17, 2024

Conversation

fenos
Copy link
Contributor

@fenos fenos commented Jan 10, 2024

What kind of change does this PR introduce?

feature

What is the new behavior?

This PR implements a couple of interesting features

  • allow the CDN to cache assets for longer useing the s-maxage directive configurable with S_MAXAGE env (default 0)
  • use stale-while-revalidate when the origin detects that the requested etag header doesn't match with what we have in the metadata, resulting in the CDN serving stale content for 30s after the initial fetch. This will increase performance.
  • the HEAD rendered will now instruct the CDN that must-revalidate when a request is sent to origin with a different etag

Additional context

Unlocks Smart-CDN-V2

@coveralls
Copy link

coveralls commented Jan 10, 2024

Pull Request Test Coverage Report for Build 7543541860

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 82.8%

Totals Coverage Status
Change from base Build 7540509992: -0.1%
Covered Lines: 7875
Relevant Lines: 9408

💛 - Coveralls

@fenos fenos merged commit 830ea71 into master Jan 17, 2024
1 check passed
@fenos fenos deleted the feat/stale-while-revalidate branch January 17, 2024 07:52
Copy link

🎉 This PR is included in version 0.46.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants