by JerryWebb · 3y ago · 0 comments
The problem is users will interact with a majority of (get) APIs through a CDN and as developers we should reduce unnecessary data sitting in the CDN because it costs quite alot of money to serve.
For example if a CDN is returning JSON data {name: “Bart”} were only paying for 50 bytes or so of data transfer. BUT if instead we convert this to HTML and serve it, we would be 10x (or more)the data stored on the CDN to serve that data.
I don’t see a strong argument for paying 10x more to serve data as HTML.
https://htmx.org/essays/two-approaches-to-decoupling/#but-th...
> Many people would object that, sure, this hypermedia API may be flexible for our web application, but it makes for a terrible general purpose API.
> This is quite true. This hypermedia API is tuned for a specific web application. It would be cumbersome and error-prone to try to download this HTML, parse it and try to extract information from it. This hypermedia API only makes sense as part of a larger hypermedia system, being consumed by a proper hypermedia client.