6 ms·
Here's how to reduce roundtrips: * Support TLS 1.3 + HTTP/2 or HTTP/3. * Reduce the number of different hosts that you connect to. The optimal number is 1. T
by hannob 3y ago
Here's how to reduce roundtrips:
* Support TLS 1.3 + HTTP/2 or HTTP/3.
* Reduce the number of different hosts that you connect to. The optimal number is 1.
That's it.
- supriyo-biswas 3y agoAdditionally, use early hints to push resources to the client before your server responds with the rendered page.
- ianlevesque 3y agoWasn't that feature already removed?
- supriyo-biswas 3y agoYou’re referring to HTTP/2 push, early hints uses two header frames in HTTP/2 or QUIC, the first one is usually pushed by your CDN containing a list of resources used on the page, and the second one is pushed out by your application and proxied by the CDN.
- danielheath 3y agoAsset domains to avoid cookies being sent on every js/css/image request?
- hannob 3y agoIs the idea here that saving the data from the cookies will speedup things, because requests become smaller? Or does it have some impact on caching or something else that I am not considering right now? I would expect that unless you have exceptionally large cookies, the saved roundtrips from another TLS handshake matter more than the data transmission for the cookies.
- webignition 3y agoIt's a security matter more than a performance matter, although improved performance is a nice side effect. For assets served from a third party (a CDN), you don't want to send cookies that might include secrets (a session cookie that could allow access to a user's account for example). You can trust that a third party won't intentionally log or make use of any sensitive information in cookies but you can't guarantee it. Best not to send it at all.
- antihero 3y ago> assets served from a third party (a CDN) Won't that naturally be on a different domain anyway? How much performance hit do cookies really have in 2023?
- hannob 3y agoI mean - if you separate your html from your assets security wise, that naturally means they need to be on different hosts, as you cannot really reroute requests before TLS decryption based on paths or any other indicator. But the motivation to put stuff on a CDN would be to improve performance. If you put your HTML on your own HW and your assets on a CDN for performance reasons, you might want to check if that really pans out, because those extra roundtrips may kill all performance savings you get from the CDN.
- klabb3 3y agoIt’s a good start but no guarantee. If you have a sequential chain of requests, for whatever reason, the number of round trips is determined by business logic. If you have anything like say a microservice/API request preceding another, you’ll see more round trips. Given the leftpad-as-a-service trend we’re seeing today, I would expect that to be quite common.