Results 1 to 2 of 2

Thread: How do I serve external JS from my site?

  1. #1
    Join Date
    Jan 2009
    Philadelphia, Pennsylvania

    How do I serve external JS from my site?

    As many of you know, I am a stickler for speed and efficiency. So I'm trying to minimize DNS lookups and external resources on my make money online blog. I've already taken care of everything... except external javascript, because I have no idea how to serve this from my own site!


    Those are the two pieces of javascript I have on my site that I need to try and serve from my own, if possible. If it's not possible, it's not a big deal. So, does anybody know how I would go about doing this? Any advice is greatly appreciated.

    Also, is it better to serve images from say: or from

  2. #2
    I think you might be missing the "why" website serve images from subdomains, this only benefits you if you set cookies to be placed on Example Web Page . (damn auto links seo titles..) www. example .com and not ,else the cookies will be sent also to the subdomain. Becuase thats what your tyring to prevent, becuase on a large scale those cookies even if only a few bytes, can scale up to a lot of network traffic and wasted bandwidth.

    Here is a Quote from Yahoo Developer.
    Yahoo Best Practices for Speeding Up Your Web Site

    Use Cookie-free Domains for Components
    When the browser makes a request for a static image and sends cookies together with the request, the server doesn't have any use for those cookies. So they only create network traffic for no good reason. You should make sure static components are requested with cookie-free requests. Create a subdomain and host all your static components there.

    If your domain is, you can host your static components on However, if you've already set cookies on the top-level domain as opposed to, then all the requests to will include those cookies. In this case, you can buy a whole new domain, host your static components there, and keep this domain cookie-free. Yahoo! uses, YouTube uses, Amazon uses and so on.

    Another benefit of hosting static components on a cookie-free domain is that some proxies might refuse to cache the components that are requested with cookies. On a related note, if you wonder if you should use or for your home page, consider the cookie impact. Omitting www leaves you no choice but to write cookies to *, so for performance reasons it's best to use the www subdomain and write the cookies to that subdomain.
    So if you serve your images from but people are still sending the cookie with the requests, then there is no benefit, it actually might be worse,like you mention about DSN Lookups, becuase then it requires another DNS lookup for your subdomain while still sending cookies.
    Unless you have so much traffic you actually need a subdomain with an A record pointing to a static content server.

    As far as the Google javascript goes, you probably cannot cache that and serve it off your website. It just doesn't seem like a good idea.
    Its also already proliferated threw-out the internet anyways, and is likely already cached in the browser of any visitor you get, so its not a big deal.
    Last edited by Keldorn; 16 December, 2009 at 03:14 AM.
    Submit new proxies -

Similar Threads

  1. PayPal Competitor- American Express 'Serve'.
    By rome9t9 in forum Business
    Replies: 11
    Last Post: 25 July, 2012, 03:36 AM
  2. Should U.S. Politicians Be Required to Serve in the Military?
    By javanx3d in forum Politics and Religion
    Replies: 19
    Last Post: 30 January, 2011, 20:22 PM
  3. Replies: 0
    Last Post: 29 September, 2010, 08:34 AM
  4. [WTS] [External Auction]
    By Bravo in forum Domains
    Replies: 0
    Last Post: 8 September, 2010, 19:04 PM
  5. [WTS] [External Auction] domain name....
    By Bravo in forum Domains
    Replies: 1
    Last Post: 25 February, 2010, 10:17 AM

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts