Jump to content

whats the point??


dreamwest

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/134456-whats-the-point/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/134456-whats-the-point/#findComment-700037
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/134456-whats-the-point/#findComment-700138
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.