Answer the question
In order to leave comments, you need to log in
How do browsers deal with 10 identical requests to a static file?
There is a function in JS in which the request lies. import('config.min.js')
If we run it 10 times in a row through forEach for each element (there are 10 of them), we will have 10 requests to the server or 1 request to the server, and the browser will leave 9 requests to the cache after the first one, when will he wait?
Answer the question
In order to leave comments, you need to log in
The behavior depends on the server response.
If the server tells the browser that the files can be cached. Those. the other 9 downloads will be made from the browser's local cache.
If the server reports that the file cannot be cached, then the browser should request it again.
In addition to caching on the browser side, an intermediate proxy server, if any, can cache. A proxy server can be used explicitly by the browser, or it can be used implicitly on the network.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question