D
D
dark_king_132020-01-17 13:58:52
Express.js
dark_king_13, 2020-01-17 13:58:52

How can I speed up the download of files from the server?

I am making a site for a creative contest, where users can upload their work, everyone can send 3 works, each of which can consist of 6 pictures (each up to 1MB) or video (up to 3 minutes) and a preview. Naturally, there are many pages on which this content needs to be loaded. And it's all loaded for a very long time, it works for me like this:

  • The user uploads files to the form
  • Files are rewritten to base64
  • send data to server via axios
  • base64 is written to a file on the server, and data about the work in the MongoDB database
  • When you go to the page, a request is made for the status and nomination of works, the necessary files are found by records in the database
  • base64 is read into the array line by line (up to 6 lines of images in one file) and sent to the client
  • On the client, Nuxt generates components into which it throws base64 and information about the work

It takes a very long time to load, how can it be accelerated?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question