两种方法都各有利弊。这实际上取决于您的用例-
First approach -
Pro - Your form posting will take less time as you would have already posted the object to S3.
Con - What if the user decides to leave the form screen without filling it? You would have a waste object on S3 and you would have to delete it separately.
Second approach -
Pro - You'll post the Object to S3 only when the user submits the form. This way you'll not be creating any unnecessary objects on S3.
Con - The user will have to wait longer as both calls are being made serially.
Now if your use case is such that very few users would cancel the form screen then it would make sense to go with the first approach else its better to go with the second approach as its more easy to maintain.
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句