I'm creating an interactive report in the form of an HTML page that needs to be accessible offline. Which of these options would yield better performance?
- Create all of the HTML in advance (via server-side scripting) and hide all of the "views" except for one (the landing page). When the user clicks on a menu item, hide the currently visible view and un-hide the view corresponding to their selection.
- Include all of the data as JavaScript variables/objects. When the user selects something from the menu, use a templating engine like Handlebars.js to create the required HTML.
I've found other posts covering client-side vs. server-side rendering, but nothing specific to offline applications that won't be able to make calls back to the server to request specific data points. In my case, all of the data (ranging from several hundred to several thousand records) must be included in the HTML from the start.