homepage Welcome to WebmasterWorld Guest from 54.198.9.77
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
Forum Library, Charter, Moderators: phranque

Website Technology Issues Forum

    
Setting DNS to server images from different domain
madmatt69




msg:3999323
 3:36 pm on Oct 1, 2009 (gmt 0)

Hey all,

Trying to implement a recommendation from google's page speed tool to serve static resource from a separate domain.

I've been using a subdomain off of my main domain for this for a while, only to discover cookies are still being sent with images and things.

Anyways - According to google this is what to do:

"register a new domain name and configure your DNS database with a CNAME record that points the new domain to your existing domain A record. "

That's where I get lost. I know how to mess around with my DNS records a little bit, but I'm kind of confused.

Where do I point the new domain to? I can create a CNAME record that points to the site's domain A record but then where should the new domain's A record be pointing to?

For example I have site.com which is the main website, and site.net which will serve images.

I tried setting up the DNS but think I have done something incorrectly, because when I type in site.net, it just re-directs me to site.com.

According to the live headers extension, it returns a status 200 but not a 301 - which worries me that maybe I'll start running into dupe content or other random issues.

Can anyone break this down for me a little?

Thanks!

 

encyclo




msg:4001551
 4:32 pm on Oct 5, 2009 (gmt 0)

There shouldn't be any significant difference between using a subdomain or a new domain, providing that the resource is on a separate server from the main site. If the new domain is pointing to the same server / document root, then yes you're likely to run into duplicate-content problems.

You can use images.example.com and either use an A record or CNAME - but the details depend on how you set up your image server.

madmatt69




msg:4001552
 4:37 pm on Oct 5, 2009 (gmt 0)

Thanks for the response. Right now I do have a subdomain I've been using (i.mysite.com) however it seems cookies are still being sent with the static resources.

The subdomain is on the same server though..Is that what the issue is? I should set it up on a completely different server?

encyclo




msg:4001564
 4:44 pm on Oct 5, 2009 (gmt 0)

The answer is "that depends" - the question is why and how those cookies are being served? Is the "i" subdomain actually mapped to a subdirectory of the main domain's document root?

In terms of performance, you're not going to gain much of the resources are on the same server, as in reality you're not reducing the server load. You can use one of the "cloud" providers to get a subdomain something.theirdomain.tld (lots of other hosting companies offer something similar) then you can have a CNAME for "i" which points to that other subdomain.

madmatt69




msg:4001579
 4:50 pm on Oct 5, 2009 (gmt 0)

hmmm yes i.mysite.com is really mapped to mysite.com/images

You think that's the issue?

Maybe serving from Amazon's cloud servers is the way to go..that way, in theory, it should be a lot faster than serving from the same server

jdMorgan




msg:4001603
 5:15 pm on Oct 5, 2009 (gmt 0)

Sounds to me like the problem is with the declared "realm" of the cookies -- with how they are defined, and not with any DNS issues or "which physical server or documentroot is used."

If the cookies are defined to apply to all subdomains, then the client will send them with any request to *.example.com.

Cookies are sent based on URLs, and the client has no knowledge of physical servers, documentroots, or 'filepaths'.

If your cookie is defined with "path=/; domain=.example.org;" (note the leading period) then it will be sent with all subdomain requests and all resource requests. If defined as "path=/; domain=www.example.org;" then it will be sent only with "www" subdomain requests and all resource requests.

Jim

[edited by: jdMorgan at 12:34 am (utc) on Jan. 31, 2010]

madmatt69




msg:4001609
 5:20 pm on Oct 5, 2009 (gmt 0)

Very interesting...thanks for the explanation. I'll have to look at the cookies that are being sent!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved