3 ms·
1.1Mb is 100 times larger than 11Kb.
by codedokode 9y ago
1.1Mb is 100 times larger than 11Kb.
- kuschku 9y agoThat would be the case when the bandwidth was the limit, but it’s not. The limit is in the immense latency for opening a new connection. Opening a network socket with TLS can take over 4 seconds on mobile, which is why ideally you’d even use an open websocket for communication instead of new GET requests. Navigating to a page in this version causes one or two network requests, in the real HN it takes far more just to check if the images have changed, the CSS has changed, etc.
- codedokode 9y agoUsing websocket looks like overengineering because HTTP/2.0 allows to use a single connection for multiple parallel requests. Using React to build a simple (student level) site like HN is overengineering too in my opinion. If you don't want to reload the page when navigating you can just reload HTML content with jQuery or fetch() without using client side rendering, without draining device battery and without loading 1 Mb of Javascript that will take much more space in RAM. SPA approach should be used for interactive applications able to work in offline mode, able to provide rich experience on mobile devices etc.