-
Notifications
You must be signed in to change notification settings - Fork 112
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
Lambda is updated before assets are uploaded #398
Comments
Yes, this was an accepted compromise from the start. Building a zero-downtime deployment would be much more complex unfortunately. |
Oh, too bad. Do you have any ideas how it could be implemented in user land instead? |
Ah, we're trying as hard as possible to avoid adding new options. I'm not sure if there are good alternatives for this problem 🤔 |
I'm running a server side website (Laravel) with built assets (Vite). Since assets will be uploaded afterwards, the new app version must
By tweaking the Vite asset resolver in Laravel and using Redis I am at least able to still refer to old assets. However, CloudFormation currently invalidates all files and hence old files are immediately not available anymore. I don't think that it will be possible to find a generic solution for the server side website case because the asset resolver of the app is key (which can obviously not be changed by this library). However, I think by configuring the paths that are about to be invalidated we could at least have a solution that not only works for this scenario but also for other scenarios where manifest files are used (SPA). |
Now that I think about it, i don't think the invalidation is the problem: there is no guarantee that older files are in cache (everywhere on the planet). To solve this 100%, the files must exist in S3 while they are still used. To be clear what I'm saying is that I don't think changing the CloudFront invalidation is the right solution, does that make sense? |
Yep, that totally makes sense 😊 I just thought that this would be a compromise to keep the current S3 sync behaviour. In that case we simply need to be able to define which folders should be synced (i.e. old files should be deleted) and which folder shouldn't? |
How about #369 (comment)? That would avoid any new option. |
Description
Currently, assets are uploaded after Lambda is updated in Server Side Website mode. This means that there is a short period of time where Lambda references to paths that do not exist yet and result in 404s. Is this a conscious design decision?
How to Reproduce
Additional Information
No response
The text was updated successfully, but these errors were encountered: