strapi icon indicating copy to clipboard operation
strapi copied to clipboard

Improve media upload performance

Open Marc-Roig opened this issue 2 years ago • 1 comments

👋🏻 What does it do?

In the upload service, when uploading image, thumbnail, and responsive formats one by one, upload them all together.

As an example, when using cloudinary: 7s before 3s now.

❓ Why is it needed?

Especially, when using nonlocal upload providers, uploading images (and not even heavy ones) was slow.

🧪 How to test it?

Upload any image in this branch and master and compare timings.

Marc-Roig avatar Aug 05 '22 11:08 Marc-Roig

Codecov Report

Merging #13995 (a013c92) into fix/cloudinary-provider-missing-catch (aca2faf) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@                          Coverage Diff                           @@
##           fix/cloudinary-provider-missing-catch   #13995   +/-   ##
======================================================================
  Coverage                                  55.26%   55.27%           
======================================================================
  Files                                       1253     1253           
  Lines                                      31593    31599    +6     
  Branches                                    5706     5706           
======================================================================
+ Hits                                       17460    17466    +6     
  Misses                                     12319    12319           
  Partials                                    1814     1814           
Flag Coverage Δ
front 57.96% <ø> (ø)
unit 48.69% <100.00%> (+0.03%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/core/upload/server/services/upload.js 28.79% <100.00%> (+2.30%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us.

codecov[bot] avatar Aug 05 '22 11:08 codecov[bot]

@MarionLemaire Yes ! that's the expected behavior.

I have to note something that I did not specify clearly. The performance improvement should be only for images. I am surprised it's faster with things other than images.

Marc-Roig avatar Aug 10 '22 13:08 Marc-Roig