Google audit:

Serve static content from a cookieless domain (15) 2.65KB of cookies were sent with the following static resources. Serve these static resources from a domain that does not set cookies:

If my domain is widgets.com, should I set up a img.widgets.com that servers these resources? How beneficial is this?


I setup img.widgets.com to serve images from, and changed all images to this URL. But I still get that message?

  • Regarding EDIT: I assume you do not specify any validity path for your cookies, so they match the main and subdomain by default.
    – Itai
    Commented Mar 5, 2011 at 17:44

3 Answers 3


Using img.widgets.com for cookieless requests won't work if your main pages are hosted on widgets.com (as opposed to a subdomain, like www.widgets.com). This is because the domain scope of a cookie is a domain and all subdomains, and so if the cookie's domain is widgets.com (necessary to get the cookie sent to widgets.com) then the cookie will also get sent in requests to img.widgets.com.

So, if your service is based on widgets.com cookies, you'd need to use a separate domain to host your cookieless items.


Each time someone request anything all cookies matching domain are sent. This adds weight to every request in proportion to how much cookies your site uses.

Since it seems your site relies heavily on cookies, you visitors should see a speed improvement if you serve images (and any static content, even css/js/etc) from a separate domain.

Google uses google.com and googlestatic.com which makes it easy to separate resources.

If you want to use subdomains (or paths) then you have to be more careful specifying your cookies' validity path.


The best reason for doing this that I can think of is for faster page loading. Since you can only download so much from one domain at a time, having your images on a separate domain allows you to load them just a little bit faster.

And from the note that google gives you, it also appears that your cookies may be impacting your image loading.

I've done this for really image heavy pages, but not for most normal pages, but if Google things its a good idea, it might be worth a try.

  • Thanks, my main concern is that a total of 3kb of cookie data has been uploaded to these images when my cookie size is about 50bytes, upload rate is the largest choker for users, so should I be working on hosting these on cookiless domains to improve load speeds?
    – Tom Gullen
    Commented Mar 5, 2011 at 17:13
  • Yeah. I'd say it would probably be best to try to host on a cookieless domain. It would probably improve performance. Commented Mar 5, 2011 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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