Tricking the server to load files faster?
Posted
by Yongho
on Stack Overflow
See other posts from Stack Overflow
or by Yongho
Published on 2010-04-14T14:17:49Z
Indexed on
2010/04/14
14:33 UTC
Read the original article
Hit count: 300
htaccess
|Performance
If we have a website with multiple images and videos, I've read that it's best to serve them from other domains so that the browser can simultaneously download a bunch of files, rather than waiting one by one for each file to be downloaded. For example, if we have a website http://example.com/, we might consider serving:
Videos from http://video.example.com/
Images from http://images.example.com/
etc.
Question: can we achieve the simultaneous downloading by tricking the browser into believing that the files are hosted there, or do they actually need to be at that location?
We can, for example, pretend to serve video from http://video.example.com/ when actually it's just a clever htaccess rewrite that ACTUALLY serves from http://example.com/video.php. In this case, the video is being served from the main domain but because we refer it as http://video.example.com/, it may think that it's another domain and thus load files simultaneously, rather than one by one.
Is this feasible?
© Stack Overflow or respective owner