4 ms·
How is it fundamentally any different than 10s of thousands of clients requesting JSON or whatever other serialized data format?
by quacker 3y ago
How is it fundamentally any different than 10s of thousands of clients requesting JSON or whatever other serialized data format?
- jdthedisciple 3y agoInsofar as only retrieving data and returning it as json is way less work for the server than retrieving data plus rendering it.
- quacker 3y agoFor the same data, why should serializing it to JSON be particularly faster than rendering it as HTML? The server is converting the data directly to a byte string in either case, which is about the same amount of work. HTML is more verbose, so I would guess that JSON serialization is slightly faster, but I doubt there's an order of magnitude difference. (I could be proven wrong though) I agree that taking HTMX to the extreme where _all_ interactions require a request to the server is too much overhead for interactive web apps. But there's likely a good middle ground where I can have mainly server side rendering of HTML fragments with a small amount of client side state/code that doesn't incur particularly more or less server load.
- quii 3y agoConverting data to a HTML string is not a performance bottleneck you'll be worrying about. I wasn't worrying about it much in 2000, and you really shouldn't need to in 2023.