Shang HTML5 Mobile Phone Development Road (Wuyi)--jquerymobile improve page access speed

Source: Internet
Author: User
Tags prefetch browser cache

Using jquery Mobile Development time you can select single-page templates and multi-page templates, which require server requirements when jumping from one page to another in a single-page template. Users will feel a slight pause.

Using multi-page templates, in order to improve the smooth jumping between pages, but more than one page to download, the following load time increased. Ring.

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 specific steps for prefetching are 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, and the loaded DOM object is too large. Cause phone memory consumption, some phones do slow or even crash.

In order to effectively save the memory resources of the mobile device browser, for pages that do not have a tag cache, they will be cleared when visiting the next page.

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvzgf3yw5nyw5iyw4=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

Assuming that you do not want to clean up the previous page in the browser cache, can be added to the corresponding DOM object Data-dom-cache= "True", in fact, another better way, through the HTML5 offline application function to cache the page content locally.

The relevant demo sample code is as follows:

<! DOCTYPE html>Prefetchpage01.html

<section id= "page_pagetransition2" data-role= "page" >
Prefetchpage02.html

<! DOCTYPE html>

Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.

Shang HTML5 Mobile Phone Development Road (Wuyi)--jquerymobile improve page access speed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.