4 ms·
Is there a layperson explanation for why https is faster than http? On the surface, "read file-> send to client" seems like less steps than "read file -> encryp
by mysterydip 5y ago
Is there a layperson explanation for why https is faster than http? On the surface, "read file-> send to client" seems like less steps than "read file -> encrypt -> send to client"
- mholt 5y ago"Faster" is ambiguous, and there are a lot of factors involved. HTTPS isn't just "add encryption", it's also "do more at once and don't block as much" because HTTP/2 (a faster version of HTTP) only uses HTTPS in practice. You can discuss "HTTPS performance" in a purist way that makes it look slower than plain HTTP, but in practice (the only way that matters) HTTPS is faster than HTTP.
- singlow 5y agoI didn't see any claim that https is faster. If you benchmark https on a path where encryption is the only significant work being done, and on hardware that does not have encryption acceleration, then it will appear to be a lot slower. However, in real world applications the https encryption is usually accelerated by a dedicated processor feature, and the other work being done for a request is going to make the encryption time irrelevant. If you are serving static files over http, on a machine with an old cpu, with enough volume to saturate your cpu on http, then https will slow it down significantly. But typically, any server doing that will have 100x more capacity than it needs anyway.
- jedberg 5y agohttp/2 is faster (for various technical reasons but basically it sends multiple things at once better than old http) and http/2 requires security. So technically http/2 is faster, but it is only possible with https.
- SahAssar 5y ago> So technically http/2 is faster, but it is only possible with https. Because of arbitrary client restrictions. http/2 can be unencrypted, and would be faster unencrypted than encrypted. It's just that all servers/clients decided to not implement the optional unencrypted mode. I'm not arguing either way, but technically it is possible to do it without https.
- seanw444 5y agoThe article they linked explained it pretty simply, I thought. One of the improvements is that rather than grabbing resources one-by-one in separate requests, it groups them into bundled single requests.