Website Speed

guest2013-1

guest
Joined
Aug 22, 2003
Messages
19,800
Hi guys,

We all know browsers have multiple threads going to a web server to download a website (or sometimes just one, depends)

Now it's been recommended that you have maximum 3 different locations on your page. Because the threading won't go out fast enough and you suffer dns overhead etc.

Now I've been thinking, if I make all my site's images load from images.acidrazor.com and all my javascript/client side files from library.acidrazor.com and my normal html from www.acidrazor.com, and have no external images loading off of other sites etc.

It should technically speed up the loading of the website correct?
 

texo

Expert Member
Joined
Jun 14, 2006
Messages
1,586
Yes this will (technically) speed things up -- it's always advisable to serve your images from a subdomain for this reason.
 

guest2013-1

guest
Joined
Aug 22, 2003
Messages
19,800
Dammit, forgot the whole reason why I posted in the first place! lol

Do you have to host the sub-domain on a different IP address than your normal www?
 

jem

Well-Known Member
Joined
Jan 9, 2008
Messages
443
yes, correct. it can improve speed.

also if you are using google analytics, cache a version of the js locally. google's servers are quite slow in serving and causes usually a good 150+ms delay on each page loading times

also compress your JS if it's a production site with JSMin or YUI compressor
 

SilverNodashi

Expert Member
Joined
Oct 12, 2007
Messages
3,337
while it could help a lot with website speed, it's not always viable for everyone. Different software, which you purchase / download off the internet doesn't always allow for images / CSS / JS files to be stored on different domains, or rather different servers.

But, using a sub domain could work very well though, cause most hosting control panels will store the sub domains in the root, or subfolder of the main site. So, setup something like images.yourdomain.co.za (where the images folder may be stored in /home/yourdomain/public_html/images), css.yourdomain.co.za & js.yourdomain.co.za - then tell your website, or application to just use /home/yourdomain/public_html/images as root for all images :)

If your websit software supports it, or if you code your own, you could even make use of a free (or paid, if needed) public file server to store the images there - this could help a bit, but also cut down on your precious bandwidth / space where needed :)
 

guest2013-1

guest
Joined
Aug 22, 2003
Messages
19,800
while it could help a lot with website speed, it's not always viable for everyone. Different software, which you purchase / download off the internet doesn't always allow for images / CSS / JS files to be stored on different domains, or rather different servers.

But, using a sub domain could work very well though, cause most hosting control panels will store the sub domains in the root, or subfolder of the main site. So, setup something like images.yourdomain.co.za (where the images folder may be stored in /home/yourdomain/public_html/images), css.yourdomain.co.za & js.yourdomain.co.za - then tell your website, or application to just use /home/yourdomain/public_html/images as root for all images :)

If your websit software supports it, or if you code your own, you could even make use of a free (or paid, if needed) public file server to store the images there - this could help a bit, but also cut down on your precious bandwidth / space where needed :)

My website software is in my brain. Give me a pen and paper and I'll write you a website. (Or notepad with a web server to test on)

I don't used prepacked crap build my own. But thanks for the advice ;)

So I assume having it on different sub domains with the same IP doesn't matter as long as it's on different subdomains.

Thanks for the Google js tip, however, could you go into more detail as to how you'd cache it?
 

James

Expert Member
Joined
May 26, 2004
Messages
2,617
The reason this works well is your browser will only make a certain number of concurrent requests to a fqdn. So splitting your images, css and js you are able to have much more loaded at the same time. Here is a great video if you are serious about this type of thing and have 36 minutes.

Yahoo! High performance websites
 

dequadin

Expert Member
Joined
May 9, 2008
Messages
1,434
RFC time
RFC2068 - Hypertext Transfer Protocol -- HTTP/1.1 said:
8.1.4 Practical Considerations
Clients that use persistent connections SHOULD limit the number of
simultaneous connections that they maintain to a given server. A
single-user client SHOULD maintain AT MOST 2 connections with any
server or proxy
. A proxy SHOULD use up to 2*N connections to another
server or proxy, where N is the number of simultaneously active
users. These guidelines are intended to improve HTTP response times
and avoid congestion of the Internet or other networks.

Full RFC here

So how I see it is this. By moving different parts of your site to sub-domains, will allow more connections (different servers). Important to note the use of SHOULD is this RFC, which means it's a recomentation not a requirement. However I think all browsers do impose connection limits of some sort to any particular server.
 

koffiejunkie

Executive Member
Joined
Aug 23, 2004
Messages
9,588
Yes this will (technically) speed things up -- it's always advisable to serve your images from a subdomain for this reason.

I will only really speed things up if your sub-domain is hosted on a separate server. If it's hosted on the same server, your two sets of connections will be queued just the same, unless the server is underutilised.

This, of course, assumes that you're on a reasonably busy server. Since most of the chatter about web hosts here are focussed on shared hosting, this sounds like a reasonable assumption.
 
Top