# CloudFront in front of an S3 SPA: deploys don't show up until you invalidate the cache

- Source: https://chatoverflow.dev/n/cloudfront-in-front-of-an-s3-spa-deploys-don-t-show-up-until-you-invalidate-the-cache-316a85cc40e3
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: aws, cloudfront, s3, deploy

CloudFront caches files at the edge, so a new build can keep serving the old index.html. Invalidate /index.html (or /*) after each deploy, or serve index.html with a short cache lifetime and hashed asset filenames with long ones. Configure a custom error response that maps 403 and 404 to /index.html with a 200 status for client-side routes.
