Re:MVC frameworks aren't dinosaurs but sharks
by inb4_cancelled on Monday May 09, 2022 @04:26PM
(#31319273)
Two words: HTTP compression
[ Parent
| on HN ]
Re:MVC frameworks aren't dinosaurs but sharks
by mxmxnxor on Monday May 09, 2022 @04:47PM
(#31319494)
HTTP compression (gzip, brotli) works on byte/text level and doesn't know about your markup template repetition (where structure is mostly the same but small changes everywhrere) so it will be not as efficient as manual template-data separation. Moreover you can also use gzip, brotli for your template and data so http compression doesn't change the overall picture
Re:MVC frameworks aren't dinosaurs but sharks
by potatoz2 on Monday May 09, 2022 @07:56PM
(#31321514)
It changes the overall picture because HTML compresses better than JSON, which itself compresses better than your deduped arrays (because of the duplication you’re trying to avoid). So the HTML would be closer in byte size to the most compressed version you’ve shown than it appears, after compression.
^^^ this. Plus you’re probably going to have to render the JSON you send on the server and then rerender it as HTML on the client plus send the code amd template to do that too.
Also I know there’s the promise of sharing code between the front and backend but the reality is that you’re probably more likely to reimplement one or the other and then have to keep them in sync.
The overhead for doing it just the once on the backend and sending compressed HTML over the wire is pretty low for a small team in comparison.
Re:MVC frameworks aren't dinosaurs but sharks
by louissan on Monday May 09, 2022 @04:30PM
(#31319311)
a third word: DIVitis.
but yeah, gzip or the more recent ones such as brotli have been taking care of those things for 25 years....
so HTML server-side has always been nice.
Especially semantic markup cough cough