Cascading is a separate problem. You can bundle all the data into a single request if you want.
You can even send JSON along with the HTML in the first request.
Cascading is a separate problem. You can bundle all the data into a single request if you want.
You can even send JSON along with the HTML in the first request.
For requests after the first, you can still continue to send the rendered HTML to be placed into the document. Here's an example using HTMX: https://htmx.org/examples/lazy-load/
Use JS to patch over things the browser doesn't implement and let it handle the rest.
This implies or assumes that sending the template again is a problem. In practice, it's not. HTML compresses well and the difference between the compressed JSON and HTML response is often on the order of hundreds of bytes. That assumes equivalent data content which, as I've said above, is often not the case. JSON payloads tend to be larger and we need more of them to render the same UI.