Answer the question
In order to leave comments, you need to log in
Distribution of statics on a separate domain
In general, such a problem, I want to distribute static on a separate server and domain.
I listened to different opinions and several questions arose:
1) What is better than a separate domain in general or a subdomain?
2) Will there be any problems with cross-domain requests? Is it possible to load images on canvas?
Answer the question
In order to leave comments, you need to log in
1. A separate domain is used to not send or parse cookies. Some sites set *.example.com cookies, which are accessible from all subdomains. Also, a separate domain, as far as I understand, can be made with a high DNS TTL and file caching, i.e. the browser will not constantly resolve its expired domain to find out where to get the files from.
If you do not have such cookies and TTL is not interesting, then just a subdomain will save you money for a new domain.
2. Isn't this solved by the Access-Control-Allow-Origin header?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question