-
-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Old static file not deleted from s3 bucket #423
Comments
There's a case to be made here for stale sessions that might've started before deployment that would still be requesting an older hash assets, so perhaps keeping x oldest is more appropriate (while nuking the rest)? |
I'd like to find a solution to this that doesn't block / add time to the main deploy command.There is a similar problem with the Lambda@Edge functions hanging around after running |
This is true that many developers may want to keep the old data into s3. I think a configuration into a serverless.yml file will be useful whether they want to keep old data or not. Also, I'm thinking if it is possible to enable versioning for both Lambda & S3. So, that we can del old version by keeping last 4 or 5. |
Made a fix for this here (while working on another issue): #803 (in draft). Actually I think only 2 versions are sufficient (current + previous) due to in-flight Lambda propagation. It does take up to a few minutes but afterwards, all CloudFront regions should have the newest Lambda. I don't think we need more than 2, unless CloudFront has some issue where somehow one is stuck on a 3rd newest version (but I think that should be extremely rare and you'd probably have bigger issues besides this?) |
Closing since this is published. It is now versioned and will automatically delete unneeded next/data files and static-pages (keeping only last 2 versions). Please try out and let me know if there are any issues. |
Describe the bug
Old static file does remain into s3 bucket every time redeploy. Which is leading to the unnecessary size increase of s3 bucket.
To Reproduce
just redeploy the existing app.
Expected behavior
all old assets should clean before uploading to the s3 bucket.
Screenshots
The text was updated successfully, but these errors were encountered: