Returning pre-rendered HTML via Ajax can outperform JSON → DOM rebuild.
Daily micro-tips for C#, SQL, performance, and scalable backend engineering.
Returning pre-rendered HTML via Ajax can outperform JSON → DOM rebuild.
fetch('/comments')
.then(r => r.text())
.then(html => container.innerHTML = html);
Why this works
Less JS work, fewer reflows, simpler rendering.