3 ms·
I disagree with the general tone here. The fact is that relatively unsophisticated frameworks often perform better from a UX point of view because of this very
by shanemhansen 14y ago
I disagree with the general tone here. The fact is that relatively unsophisticated frameworks often perform better from a UX point of view because of this very reason.
I know I'm over-generalizing here, but most PHP apps can print a the website's headers and navigation and send those to the browser before it starts doing the heavy lifting. The reason? Basically because they are just a smart template, and the logic is in the view.
Java JSP's are actually the same. Very often you can see a jsp powered site print the website headers and CSS so that the browser can be rendering while the server is still working.
The problem with most MVC frameworks is that their interface looks like HTTPResponse process(HTTPRequest), which doesn't imply but pretty strongly suggests that the server isn't going to send any data back until the request is finished processing. Generators provide an API that theoretically gets around this limitation, but in reality would require massive amounts of coding in order to make all the iterators involved lazy.
So using some dumb, non mvc frameworks, it's easy to get a shorter time-to-first-byte. With a fancy MVC framework, it's pretty difficult and involves lots of lazy loading (to delay the processing associated with database requests).
So yes, MVC as implemented by most of the web, might be slowing down your site, and despite the relative sophistication of the HN crowd, it's not a problem that most front-end devs have on their radar.
- sallamar 14y agoWell said. Pages that start with the view like PHP and JSP fare better than most dumb MVC frameworks.