Add an attribute to prevent particular pages from caching
I ran into circumstances where I don't want certain pages in my app to cache. I think there should be an attribute that can be added to any div tag with date-role='page' such as data-cache="false" which would prevent that page from caching.
For my solution, I added a 'pagehide' binding in the dom ready event of the root index page for the app:
- $j("div[data-role*='page']").live('pagehide', function(event, ui) {
if ($j(this).children("div[data-role*='content']").is(".command-no-cache"))
$j(this).remove();
});
And then I simply add the class 'command-no-cache' to 'content' data-role div for each page. This way upon leaving the page it removes itself from the cached dom.