dreamwest Posted November 27, 2008 Share Posted November 27, 2008 whats the point of using subdomains for images, js etc when you can use .htaccess to cache images just seems like less work to add: <FilesMatch "\.(jpg|jpeg|gif|ico)$"> Header set Cache-Control "max-age=604800, public" </FilesMatch> instead of creating multiple subdomains Quote Link to comment https://forums.phpfreaks.com/topic/134456-whats-the-point/ Share on other sites More sharing options...
rhodesa Posted November 27, 2008 Share Posted November 27, 2008 caching doesn't affect the first loading of those files though. the reason for a subdomain is that a browser will limit the number of connections to a host (i think it's around 3). By having files spread out over subdomains, you can have that many connections per subdomain, leading to a faster page load. Quote Link to comment https://forums.phpfreaks.com/topic/134456-whats-the-point/#findComment-700037 Share on other sites More sharing options...
trq Posted November 27, 2008 Share Posted November 27, 2008 Often subdomains may point to a seperate server as well, thus reducing (or spreading) server load. Quote Link to comment https://forums.phpfreaks.com/topic/134456-whats-the-point/#findComment-700039 Share on other sites More sharing options...
corbin Posted November 27, 2008 Share Posted November 27, 2008 To piggyback on thorpe's post, sometimes subdomains not only point to different hardware servers but different software servers too. For example, lighthttpd is used sometimes for serving just static content. The overhead of one request on lighthttpd can be 1/10 of the size of one under Apache with some modules loaded. A couple of big sites use this method, but I can't remember any off the top of my head x.x. Quote Link to comment https://forums.phpfreaks.com/topic/134456-whats-the-point/#findComment-700138 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.