News for hackers. Stuff that matters.
Re:Your Cache Headers Could Probably be More Aggressive by hannob on Thursday September 21, 2023 @04:20AM (#37594718)
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.

Re:Your Cache Headers Could Probably be More Aggressive by supriyo-biswas on Thursday September 21, 2023 @04:32AM (#37594802)
Additionally, use early hints to push resources to the client before your server responds with the rendered page.
Re:Your Cache Headers Could Probably be More Aggressive by ianlevesque on Thursday September 21, 2023 @10:40AM (#37598324)
Wasn't that feature already removed?
Re:Your Cache Headers Could Probably be More Aggressive by supriyo-biswas on Friday September 22, 2023 @05:35AM (#37609892)
You’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.
Re:Your Cache Headers Could Probably be More Aggressive by danielheath on Thursday September 21, 2023 @05:16AM (#37595165)
Asset domains to avoid cookies being sent on every js/css/image request?
Re:Your Cache Headers Could Probably be More Aggressive by hannob on Thursday September 21, 2023 @05:22AM (#37595210)
Is 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.

Re:Your Cache Headers Could Probably be More Aggressive by webignition on Thursday September 21, 2023 @05:37AM (#37595327)
It'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.

Re:Your Cache Headers Could Probably be More Aggressive by antihero on Thursday September 21, 2023 @05:44AM (#37595378)
> 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?

Re:Your Cache Headers Could Probably be More Aggressive by hannob on Thursday September 21, 2023 @06:44AM (#37595799)
I 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.

Re:Your Cache Headers Could Probably be More Aggressive by klabb3 on Thursday September 21, 2023 @06:28AM (#37595683)
It’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.