A good single-page web application should in my opinion be as close as possible (and sensible) to a traditional web application, which does a full page (re-)load on every user action. In particular, a single-page web application should support the browser history, including the back and forward buttons.
Most frameworks for single-page web applications do support the browser history. But they do not seem to emulate one crucial thing: When I am on, say, page 1 of a traditional web application and fill in a form field, navigate away to page 2 of the application and then click the back button, the browser will restore my input.
With a single-page web application, one of two things usually happens: Either the form field of page 1 is still part of the DOM (but hidden) on page 2 (or at least part of a Javascript data structure), so that the application may show me the filled-in form field again after navigating back, or the form field is created anew everytime I visit page 1 (either through direct navigation or by pressing the back button). In the latter case, my former input is not restored.
It seems clear that the former is the better. But even this solution isn't perfect: In a tradition web application, each history entry has its own cached values of form fields, even if the history contains the previously mentioned page 1 several times. The single-page application which doesn't recreate the form fields on every in-application navigation, however, caches only a single value for every form field.
One idea to solve this problem and making single-page web applications better, would be to store the values of the form fields in the data attribute of the pushState and replaceState methods of the HTML5 history interface to have them stored along the other history information. Of course, the current history entry has to be kept updated before the user navigates away, so one would have to use onchange-event handlers on all form controls that update the current history entry using replaceState.
Now my question is whether there is a better solution to the problem described above and whether there are any single-page web application frameworks/libraries that take care of it.