So here's the deal,
I am building out a site right now and want to plan for the future, in terms of performance and such. One performance trick that I've been reading about lately talks about placing images, javascript, and css (all static) files on a separate subdomain/s so that the client will experience a faster download experience when they hit the site.
I understand why this works and am not looking for an explanation of that, but how do I go about setting up my site (makes use PHP) to automatically reference these sub domains when the site leaves my local dev environment?
Right now images can be found here in the local/dev site:
http://localhost/mysitename/assets/css/images/img1.gif
Production site:
http://www.mysitename.com/assets/css/images/img1.gif
I would like to have my Production (Just production, not the local/dev environment) server point to the following:
http://images.mysitename.com/img1.gif
I am wondering how to do this is some automated way? Without having to manually make this change across all of the static files found on the site. (Maybe htaccess but not sure how)
Thank you.