Search code examples
reactjsamazon-cloudfront

CloudFront cache invalidation for React app


I have a React/redux app which is deployed on CloudFront + s3. There is no static hosting enabled on the bucket. I understand that invalidating cache on a new deployment clears cache in all the edge locations and the new changes will be served up. But what happens to the active prod users when the cache is invalidated? Are they able to continue on the app without any errors? Does it get worse for the active users if the redux store structure changed in the new version?


Solution

  • Clearing the cloudfront cache will bring up the fresh content from your origin. However, that would not affect the existing production users. They would continue to be served from the cached content as long as their session continues.

    That being said, they would be served the fresh content when their session restarts. There would be no errors whatsoever.

    Hope this helps.