Any way to reduce repetitive markup in webpages or something like caching such frequently used markup?
When you have the same set of buttons on each item row of a long list of items. Is ther开发者_StackOverflow中文版e any way to reduce the markup (of repeated elements on the page)? Any way to make it more efficient ?
Is there any facility to cache that kind of markup like CSS or js files. I am looking out for this solution for a web 2.0 site.
Edit
Not looking for a server side solution, as I am already aware of those. I am bascially concerned about reducing file size of my webpages transferred to user's browser.
There are a few ways:
Generate the HTML using a server-side language (PHP, ASP, etc) and use loops to create the repetitive markup
Create the markup in Javascript, inserting elements into the DOM via a loop.
Use a template to provide the markup, and include the template as many times as needed.
精彩评论