Cloudfront support for stale-while-revalidate

17

Are there any plans to support the stale-while-revalidate cache in CloudFront or are there any alternatives to mimic this behavior?

RFC: https://datatracker.ietf.org/doc/html/rfc5861#section-3

There is also a very old post on AWS Forums from 2014, where this question was asked the first time https://forums.aws.amazon.com/thread.jspa?threadID=161496

7개 답변
11

+1 this is a pretty standard feature on most cdns just not cloudfront, so need to know if I need to be looking at alternative providers.

답변함 2년 전
8

+1. I would also very much like this feature, to be able to support Incremental Static Regeneration for our NextJS app. I can also imagine that this is really helpful for the AWS Amplify product since that also supports NextJS and I would therefor think they can use this functionality to support ISR on NextJS as well. tf-next (a zero config terraform module for hosting NextJS apps in AWS) also has GitHub issue related to this.

Overall, this functionality would be really helpful!

답변함 2년 전
5

+1 I've been waiting for over 4 years for this to be supported. For my purposes, it's the feature that that cloudfront is missing that makes fastly a better option for many of my applications. Cloudfront team, please support this header!!

etk007
답변함 2년 전
4

+1 this is a pretty standard feature...

답변함 2년 전
3

+1 this is absolutely required to make it feasible to deploy your NextJS site on AWS behind CloudFront as opposed to on Vercel or Netlify or other competitors.

mish
답변함 2년 전
2

Hey, this really should be added as a feature. Has this been seen at any level of AWS yet?

답변함 2년 전
0

Looks like CloudFront finally started supporting stale-while-revalidate=N some time in April 2023, without any announcement or documentation update. Testing shows that – at least in its current implementation as of Apr 2023 – they don't actually follow the RFC recommendation of not blocking during the revalidation: If, upon expiry of the object, the origin takes 2 seconds to respond with a 502, then the client will also have to wait for 2 seconds while CloudFront completes the origin request. Only after that period will CloudFront serve the stale object.

svenx
답변함 일 년 전
  • Hi, Could advice if any documentation to follow for configuring this parameter in CF?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠