Skip to content

Preserving old build assets through deployments #3566

@AvivonCtrl

Description

@AvivonCtrl

Before opening, please confirm:

App Id

d1rhgw330dvjl7

AWS Region

eu-west-1

Amplify Hosting feature

Build settings, Deployments, Frontend builds

Question

Generally referring to this issue:
vitejs/vite#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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions