I'm building a Durandal SPA that may benefit from a cacheViews setting of true or false, depending on the individuals usage of the app. This is how I currently have it set in shell.html:
<div class="page-host" data-bind="router: { cacheViews:true }"></div>
And in a child router like in samples/index.html:
<div>
<!--ko router: { cacheViews:false }--><!--/ko-->
</div>
1) Can these be changed at runtime? If so, how?. Does it matter that one is using data-bind and the other is using ko comment style?
2) How granular is this value? Is it per "router" or per "route"? As you can see, I have a parent router and a child router, so there are 2 places in my html code where I can set cacheViews. From my testing, it appears as if they are independent of each other. Can anyone confirm? Can I set this value on individual routes like /#page1, /#page2, /#samples/list, etc?
3) Because the page event life-cycle is different between true/false I need to have some specific logic in my vm depending on this value. How can I retrieve it for the current route?
Thanks