Forum Moderators: phranque

Message Too Old, No Replies

use subdomains for static content

use subdomains for static content

         

krmkrm

1:53 pm on Feb 15, 2009 (gmt 0)

10+ Year Member



Hello, i want to use a subdomain for my static contents like js css and image files.

I also use wordpress and its hard to call wordpress' js content from another place.
So i come up with a silly idea that cheating the browser.
I dont know maybe this makes no sense.
When page asks for a file from wp-includes/js
could it redirect it through a subdomain which has got the same files inside. Could it be possible? If yes, how?

Or how can i make this happen in another way.

Thanks a lot
K

jdMorgan

4:41 pm on Feb 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You *could* redirect these requests, but the user would see the delay on every request for the remotely-hosted images and scripts. Also, the initial requests would be logged on your main server, and the redirected requests would also be logged on the remote server. Therefore, your "stats" on the main server would be inaccurate.

It's not clear why you might want to remotely host the images and scripts, but if the goal is to improve performance, then using redirects may defeat that goal.

You might be able to proxy these image and script requests through the main server to the remote server, avoiding the client redirect. This also has side effects in performance and logging.

If you are hosted on Apache 2.x, you might be able to create an output filter to change WP's links on-the-fly.

In order to give informed recommendations, it would be helpful to know *why* you think you need to off-load the image and script hosting.

Jim

krmkrm

5:18 pm on Feb 15, 2009 (gmt 0)

10+ Year Member



jdMorgan thanks for the reply. I was thinking the same thing. This not a good idea. Maybe a better server will do good.
I got a host from godaddy. Godaddy uses 1.3.
The reason why i asked is because there are too many js,css and also image files and i want to reduce the page loading time with dividing them.