CloudFront does not yet support stale-while-revalidate.

Is this possible to implement in the edge with a lambda?

closed as off-topic by 030, Pierre.Vriens, chicks, Tensibai Dec 6 '17 at 10:13

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about general programming problems are not on-topic unless they relate to DevOps in some way. You may be able to get help on Stack Overflow instead." – 030, chicks, Tensibai
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    Please QA-review the link I added to your question. If you know a better one, please feel free to replace it. But please add "some" link to briefly explain what you're talking about (don't assume that all DevOps users know/speak the same AWS-ese, or whatever, language). Good luck! – Pierre.Vriens Nov 17 '17 at 15:48
  • I don't see how this could be emulated with Lambda@Edge, since request and response triggers would not fire on the origin side unless the object is already stale and would not fire on the viewer response side until either a non-stale response is returned from the cache or a response from a fresh origin fetch or revalidation have occurred. – Michael - sqlbot Nov 18 '17 at 0:44
  • This behavior isn't really consistent with CloudFront's design, as the required asynchronous refresh is something CloudFront never does -- every origin request will be returned to a viewer who is waiting for it... not made proactively or productively. This behavior seems to belong adjacent to the origin. What are you trying to accomplish/what's the application? – Michael - sqlbot Nov 18 '17 at 0:46