Can f7 cache more than 2 pages?


#1

I ’ m using framework 7 v1.6.3 at the moment, and I want to cache more than 3 pages.

In my app, a user enters a detail page of feed from the main list page, and in detail page, the user can enter the edit page if he or she is a poster.
Now, when user enter edit page, main list view page is cleared from the cache. and when they come back to main page, this page is refreshed.

It’s inconvenient when users scroll to the middle of list in main page. When they come back, list is initialised and scroll is back to top. Users need to scroll again to the middle to see the next feed.

Is is possible to cache more than 3 pages using v1.6.3?
Any help would be appreciated.

Sorry for my broken English!


#2

Hi,

Sure you can,

you can enable stack pages to keep all pages in DOM,

view:{
stackPages:true,
}

just add this to your app parameters


#3

Thank you for your reply.
I’ll check it.

May I ask you one more?
Is it possible to define cached page count?
For example, I want to cache up to 3 pages, no more.


#4

I add it to my app parameter, but nothing changes.

Here is my app configuration.

var myApp = new Framework7({
cache: false,
swipeBackPage: false,
animatePages: false,
lazy: {
threshold: 100,
sequential: false
},
fastClicks: false,
view: {
stackPages:true
}
});

And I use f7 v1.6.3


#5

In v1 that parameter was called domCache http://v1.framework7.io/docs/views.html


#6

Thanks for your reply.
I checked above url and added domCache parameter to my app.
But I can hardly see any change in my app. It still saves only two pages.

Here’s my configuration.

var myApp = new Framework7({
cache: false,
swipeBackPage: false,
animatePages: false,
lazy: {
threshold: 100,
sequential: false
},
fastClicks: false,
domCache: true
});


#7

As doc states you should put it as View parameter