A
A
angelzzz2020-01-14 16:30:41
React
angelzzz, 2020-01-14 16:30:41

How to load files at application start and show progress bar?

I am using MERN (Mongo, React, Express, Node).
I want to make sure that when the application starts, all the necessary files are loaded from AWS and other servers (there are photos, videos, audios). And then in the process of work to use these files without recourse to the server. Hence a few questions:
1. How to make a progress bar when downloading these files? For download I use axios. As I understand it, it is necessary to do Promise.allin which to transfer the list axios.get. How can I show which file is being downloaded and change the state of the progress bar when downloading each file, respectively (maybe even take into account the file size?)
2. How can I use these files later? I came across Serviceworker by searching, do I understand correctly that in the simplest form, I just need it to be connected in the standard create-react-app? Do I need to take some additional steps so that in the future the files are not loaded from the server, but are shown from the cache?
Thank you!

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