I currently load all my files on one domain.

I thought it would be better to load all js, media and css content from a subdomain, like:

http://media.domain.com
http://js.domain.com
http://css.domain.com

Does anybody know if this improve the speed positive?

share|improve this question
    
yes ,sure it improve the site speed...But you need upload file js and css,media files to your base site magent dir – Amit Bera Jun 15 '15 at 14:10
    
dont forget that you need to properly configure cache and ignore cookies... – user2857 Jun 15 '15 at 17:20
up vote 2 down vote accepted

You can achieve this by creating a subdomain on your server configuration and linking the root folder of the new subdomain to the js/css folders you want to server from there with something like

ln -s /var/www/html/domain.com/magento/media /var/www/html/domain.com/cdn/media for skin and js folders.

This guide shows you how to achieve this on nginx, it should be pretty straightforward with apache too.

You can add some expire headers for the resources in the vhost creation or in a .htacess too.

Then go to System > Configuration > Web > Unsecure and change {{unsecure_base_url}} to the new subdomain you created for all the resources you want to server from your local CDN. Same for Secure urls.

share|improve this answer
    
why does he have to do all this ?? creating a fake CDN is just pointing your subdomain to the same ip address as your main domain... nothing else, and change magento media url to http://media.domain.com/media. for any advanced CDN he needs to run any separate vps... – user2857 Jun 15 '15 at 17:17
    
and your guide has no caching rules – user2857 Jun 15 '15 at 17:21
    
@ADM create another answer or edit mine's if you think you can improve it. – mbalparda Jun 15 '15 at 17:24

@ADM - because browsers will limit the amount of requests coming from a single domain. With more domains, the browser will accept more connections hense making for a speedier overall render time

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.