Hacker News new | past | comments | ask | show | jobs | submit login

Which is more beneficial in today's web: Serving static contents from a cookieless domain but two dns lookups vs. all contents from same domain, but one dns lookup?



I think there's no straightforward answer to this. E.g. why would you have 2 DNS look-ups with cookieless domain? I imagine that means cdn.mydomain.com and mydomain.com?

If you're using HTTP/2, then one domain is better, because you can use the same persistent connection to multiplex your traffic. Well, technically, if you use the same IP and SSL cert then you can HTTP/2 Push the contents to the client (doesn't have to be the same domain).

However if your web server is slow or if the distance between the client and your web server is significant then you're likely not going to benefit from the performance gains of using one connection, because of the network propagation delay (vs low latency POPs from major CDNs).

Lastly, your static assets don't have to be on a cookieless domains, you can just strip the cookies and cache the content - that's what many varnish instances do ;)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: