4 ms·
"Blank page" problem is usually only a problem if your site is really slow, but if it is fast (because of server side rendering) it is less of a problem. As th
by fetbaffe 6y ago
"Blank page" problem is usually only a problem if your site is really slow, but if it is fast (because of server side rendering) it is less of a problem.
As the presenter in the video said, browsers can render HTML documents really fast, this leads to some interesting conclusions.
Assume that you need to render a modal as popup for each item in a grid.
Frontend solution would be to reuse the same modal for every item and just swap in the on-the-fly rendered content for that item. Or maybe even on-the-fly create & render the entire modal when needed.
Backend solution would be to render one modal per item. This is actually easier, just loop & have unique ids (you can even reuse the same loop that you build the grid with) & no need for dynamic loading, rendering, etc. So even if you send more HTML down the line, the page acts smother.
- ebiester 6y agoLet's say you have a query that takes 3 seconds, and about half second to manipulate that into something that makes sense and start sending the data over. With the single page solution, you can have a spinner that is allowing the user to know that something is happening. What does it look like if you click that link?
- seba_dos1 6y agoThe browser is instantly showing a spinner to let user know that something is happening, and after 3 seconds the page switches to a new one. That's exactly how this very site we're on right now works, for instance.
- fanf2 6y agoYou know browsers have built-in loading spinners? https://media.giphy.com/media/anjRJ4nv9WJzO/source.gif https://media.giphy.com/media/anjRJ4nv9WJzO/source.gif In my experience, any time a web site reimplements basic browser functionality in JavaScript (e.g. loading spinners, scrolling, navigation) it is slow, buggy, and annoying.