3 ms·
Backend latency should be negligible next to RTT latency though. If RTT is on the order of 100 ms, shaving off 5-10 ms for request processing doesn't help much.
by ndriscoll 2y ago
Backend latency should be negligible next to RTT latency though. If RTT is on the order of 100 ms, shaving off 5-10 ms for request processing doesn't help much.
I don't know the history here, but nginx seemed to have a solution (which was removed) to be able to conditionally attach pushes to a location directive based on a cookie, and then set that cookie to know if it was a first visit. Seems simple enough? Did it actually never work or something?
- bawolff 2y ago> Backend latency should be negligible next to RTT latency though "Should" is doing a lot of work there. For dynamic resources this is often very not true. On the other hand i suppose the landing page is often highly optimized. The cookie approach does seem like the most common approach to that problem. I have no idea how well it worked.
- kijin 2y agoA modern SPA is often just a static HTML page that loads a whole bunch of minified JS. Backend latency is indeed negligible in that case, compared to the RTT for the multiple MB of scripts that you need to load, parse and execute. A more traditional multi-page website, on the other hand, can benefit a lot from putting a CDN in front of it. Once the main dynamic resource has been generated, the rest of your assets can be loaded from edge servers closer to your users. When RTT is on the order of 10ms, it doesn't really matter whether you push or pull.
- bawolff 2y agoSure there are scenarios where it doesn't really matter, but that is not everyone. Edge caching is great if resources can be shared. Sometimes resources are per-user. SPA's that involve dynamic per user content still have to load it to show the user anything interesting. Edge caching is definitely not 10ms for everyone. Depending on who you are targeting that could be a reasonable assumption, but it is definitely not true of the world at large.