Let's assume i have 50 views in my app, all of these views include user html.
<div>Hi, im a user</div>
What would be faster, loading and rendering the user view in the client and using the template engine to attach it to all of the other 50 views OR if this piece of HTML were on each of the 50 views, making their files larger, but eliminating the need for client rendering and the additional Http request?
Edit
I'm not concerned about duplicate code, we will compile the small piece of code, so it won't be duplicated. The question is strictly about speed of larger HTML files VS client rendering + http request.
Aucun commentaire:
Enregistrer un commentaire