When using jquery Mobile for development, you can choose a single-page template and a multi-page template, when you use a single-page template to jump from one page to another page when you need to request from the server, the user will feel a slight pause. With multi-page templates, you can improve the smoothness of page jumps, but multiple pages are downloaded at once, so the download time becomes longer and the user experience is affected.
In the development of prefetch-based technology, when the first page's Dom object is loaded, JQuery Mobile will prefetch the linked address of the tag data-prefetch. The detailed procedure for prefetching is as follows:
Note: When using prefetch, it is not recommended to add the Data-prefetch property to all links, because too many Data-prefetch properties cause the mobile device to prefetch too many pages, loading DOM objects too large, causing phone memory consumption, some phones running slowly or even crashing.
In order to effectively save the memory resources of the mobile device browser, the page without tag cache will be cleared when the next page is accessed.
If you do not want to clean up the previous page in the browser cache, you can add Data-dom-cache= "true" on the corresponding DOM object, there is a better way to use the HTML5 offline application function to cache the content of the page locally.
The relevant sample code is as follows:
<! DOCTYPE html>Prefetchpage01.html<section id= "page_pagetransition2" data-role= "page" >
Prefetchpage02.html<! DOCTYPE html>