speedup your site – 2static.it
Since google launched pagespeed add-on for firefox, everybody is talking about how to speedup you site, but there are few instructions about one aspect : the cookieless domain.
We should serve static components( css, images, javascript ) with no cookies at all. Cookies are sent and received each time we make a request to the server. So from the bandwidth point of view, and of course load time for the user’s browser, this is bad.
More data about this here.
After talking more with Kyle Simpson or @getify on twitter , the author of labjs, about this, he come with the next comments:
Most people don’t realize that “global cookies” (those that are set by session cookies and usually by analytics packages) creep over even into sub-domains of your main page domain.
It’s very common for people to set up something like “static.mydomain.com” and load all their assets that way
they think this protects those requests.
It usually doesn’t because they have some analytics package that sets cookies like “.mydomain.com”… notice the leading “.”, it means that ALL subdomains are included.
So it defeats the purpose of having your own sub-domain to “strip cookies”, so using an entirely separate domain is the only answer.
Now there are some solutions to address this issue:
- to use a CDN, and set it to remove cookies( which could be expensive)
- to use a cookieless server, and make a bunch of changes in your httpd.conf( in the case of apache ), but this requires root access on the server, and for the majority of shared hosting solutions this is not available.
Another easy and free solution would be to use 2static.it ( in beta now ).
2static.it is offering this as a FREE service, it strips the cookies, assigns you a DNS alias and makes the DNS redirect to your site.
This way the most complication you might have is to ask your hosting to create the alias for you, in case you cannot do it by yourself.
Starting form here all you need to do is to use the new alias for the static resources of your site.
I suggest you to read the faq page, as it explains in details what it does.



