W
W
weranda2017-10-29 07:46:23
Server optimization
weranda, 2017-10-29 07:46:23

Why is it not a subdomain, but another domain that is used to return "statics"?

Greetings
As far as I know, some place static files on a subdomain, others on a different domain. Please explain what is the difference between hosting on a subdomain and another domain.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
sim3x, 2017-10-29
@weranda

Cookies
Often the cookies of the "main site" are distributed to its own subdomains.
The client sends 1-2kb of cookies for each request for statics
. With large volumes of requests, it is very expensive.
From a security point of view, statics can be compromised, but the cookie return policy in the browser will not static server read user cookie

S
SagePtr, 2017-10-29
@SagePtr

There is no difference in this. A subdomain is the same "other domain" both from the point of view of the browser and from the point of view of the server.

P
Puma Thailand, 2017-10-29
@opium

it makes no
sense that sdn usually have their own domains and don’t want to fool around screwing their subdomains
domains cost about nothing, you can type a bunch

Z
zooks, 2017-10-29
@zooks

On a subdomain, static will load faster if HTTP/2 is not enabled.
The other domain hosts specialized CDN storages.

A
Antoha1787, 2017-12-12
@Antoha1787

Moving static to a subdomain is not a particularly effective recommendation.
Briefly:
1. It is possible to achieve a slight decrease in transmitted data due to the absence of cookies on subdomains.
2. Browsers have limits on simultaneous connections to one domain and for this reason, in theory, more streams can be used for downloads.
Of the minuses - the download will be delayed for the duration of the DNS request. And this, in the end, can slow down the loading of the page itself and delay the start of proper rendering for the visitor (in the case of js\css\fonts).
A better and more efficient alternative is to connect your site to a good CDN. It is worth choosing with the maximum coverage of the Russian Federation / CIS. I can recommend WSR. Connecting via DNS - just add the site to the service and register their servers. The trick is that they cache both statics and dynamics + all site links remain unchanged.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question