Application Performance Series- Part 5- Use Cookie free Domains for Components
This is part 5 of a multiple part series on web performance improvements. The first Introductory blog can be found here. In previous part we discussed about CDN and how they improve the performance of the web application. In this part we will discuss the benefits of cookie-free domains.
When the browser makes a request for a static image it also 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. We should make sure static components are requested with cookie-free requests.
To achieve this we should create a sub-domain and host all static components there. If the domain is www.example.org, we can host static components on static.example.org. However, if we have already set cookies on the top-level domain example.org as opposed to www.example.org, then all the requests to static.example.org will include those cookies. In this case, we can buy a whole new domain, host static components there, and keep this domain cookie-free.