aws-amplify / aws-amplify/amplify-hosting
Preserving old build assets through deployments
- Dominant language
- Dockerfile
- Stars
- 481
- Forks
- 123
- PR merge metrics
- No merged PRs in 30d
Description
### Before opening, please confirm:
- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting questions](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have removed any sensitive information from my code snippets and submission.
### App Id
d1rhgw330dvjl7
### AWS Region
eu-west-1
### Amplify Hosting feature
Build settings, Deployments, Frontend builds
### Question
Generally referring to this issue:
https://github.com/vitejs/vite/issues/11804
There are use cases where preserving previous build assets might be desirable, such as when wanting to serve previous code splitting chunks -- a user's browser may cache older chunks that refer to previous versions of the application.
If these chunks are not available because a new deployment has replaced them.
If a user's browser attempts to fetch a previously cached chunk that no longer exists due to a new deployment, it results in a failed network request, and consequently, a broken user experience.
To my understanding, up until a few releases ago - Amplify's CDN used to serve previous build assets, and it was abruptly changed.
Therefore, having a built-in mechanism in Amplify to ensure that older build assets remain available would be extremely beneficial. This would allow more robust implementation of code splitting, provide better control over cache management, and ensure a seamless user experience even after new deployments.
Contributor guide
Research direction
The issue names no repository file, test, or entry point; start by locating the Amplify Hosting deployment and CDN asset-retention path. Define how older build assets should persist across deployments, then verify the behavior against the cached-chunk scenario described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- ci-cd, cloud, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100