Parallel download of .js files via https

We are considering dividing our .js into two-domain service with the intention of allowing simultaneous downloads.

Question: Can we: a) use subdomains for this purpose and b) will the matching download also be saved via https?

For example, we would like to request two files:

https://www.example.com/firstfile.js
https://subdomain.example.com/secondfile.js

doable? Alternatives?

+3
source share
5 answers

As far as I know, this will not work. Scripts are configured to block concurrent downloads. The reason for this is that parallel loading of scripts can lead to race conditions in your javascript. Minimal or on-demand downloads are your best options.

+3
source

, ( , , ). - , HTTP-.

http.
(+ minim + gzip)

+3

, , , . HTTP/1.1 , . , , . script . ()

.

+1

a) . document.domain, .

b) , , .

0

, " -" " -" ( ) javascript / javascript, ,

, , , .

,

0

Source: https://habr.com/ru/post/1732099/


All Articles