Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
how to cache page content !!
meisam3322 last edited by
hi, i have some pages that need get some data from server by internet. i use pushPage and tried bringPageTop to navigate pages. all works well. but when i back or go to a page i will try to load contens from server again. i try to call function for getting content from internet in page init or show event but unfortunately contents get lost and need to load and request from server again and again when back to page.
is there any way to cache content, because onsen only keep contents before ons.ready after that every contents added to pages will lost when page back or go to another pages.
thank you for help and idea.
@meisam3322 Pages are destroyed when they are popped from the stack. Why don’t you just save your data outside the page? the
initevent can perform the request if there is no data available, get the data and store it. Every time after that you just use the saved data.