I have seen that many websites have a separate domain name (not a subdomain) for loading scripts and static assets.
One example is GitLab loads its scripts from assets.gitlab-static.net
when the actual website is on gitlab.com
. There are many more I have observed which do the same.
What benefits could be gained through loading a websites own scripts through another domain name instead of using the same domain or a subdomain?
To be clear:
- I am not asking why the example given does this but what any website in general would gain through this.
- I am not asking about why user uploaded content is stored on another domain but purely why a websites own CSS/JS is loaded from another domain.