Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Control how the CloudFront cache is invalidated #369

Open
Nyholm opened this issue Oct 26, 2023 · 4 comments
Open

Control how the CloudFront cache is invalidated #369

Nyholm opened this issue Oct 26, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@Nyholm
Copy link

Nyholm commented Oct 26, 2023

Start from the Use-case

I am running a single page react app. I have 10 different JS files (chunks) after I build my app.

It is normal that a user request 3-5 js files while they are using a part of the application. When they browse to another part they will download more files.

There is an issue if I decide to deploy a new version. Then the additional files are removed from the S3 and CDN. Now when the user asks for the additional files they get a 404.

I suggest to allow us to keep some files on S3 or CloudFront.
Of course I would be open for alternative solutions

Example Config

No response

Implementation Idea

No response

@Nyholm Nyholm added the enhancement New feature or request label Oct 26, 2023
@mnapoli
Copy link
Member

mnapoli commented Oct 26, 2023

I wonder if we could (and if S3 allows it), instead of deleting "obsolete" files, set them to expire (be deleted) after 1 day 🤔 I haven't researched that at all but that would be a solution that we could apply by default for everyone?

@jaulz
Copy link
Contributor

jaulz commented Jul 2, 2024

Probably related to #398

@jaulz
Copy link
Contributor

jaulz commented Jul 3, 2024

@mnapoli yep, I was researching on the very same right now. I wonder if we could tag all obsolete files and then use a lifecycle rule to delete these tagged files after a day. The question is whether there is an efficient way to compare and add those tags. Maybe we can create a similar function s3SoftDelete?

async function s3Delete(aws: AwsProvider, bucket: string, keys: string[]): Promise<void> {

@mnapoli
Copy link
Member

mnapoli commented Jul 3, 2024

Why not, as long as it works

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants