简体   繁体   中英

iPhone web apps: performance hotspots? Caching? JavaScript bottlenecks?

I'm starting to make an iPhone app with jQTouch - so I'm keen to hear some best practises.

I'm developing for iPhones users on a UK 3G connection.

  • Any particular things that cause script blocking?
  • What are the main performance hotspots?
  • Whats the deal with browser caching?
  • If the iPhone doesn't cache should I include my scripts and styles in the page?

Basically, I'm looking for some general tips and absolute no-no's!

I have developed four web apps for the iPhone specifically, the first two using JQTouch and the last two using my own framework I put together in a day and a half - I switched from JQTouch because it was slow, unwieldy and heavy to use, and my own replacement was significnatly lighter, faster and did everything exactly as I wanted it.

Regarding caching, take a good look at the cache manifest file that Safari implements as part of html5 - this will give hints to Safari as to what needs to be cached locally and cuts down on access times a lot.

Keep your page sizes down - if you have a lot of data, use html5 local storage to store data and JQuery to dynamically create application pages as you go. JQuery can choke if you do not design your page hierarchy well, and have lots of elements in the page (my last project had 50 top level categories, each with 10 subcategories, each with 10 options - putting all of those in the page itself caused JQuery to hang for 5 to 10 seconds on first lookup, while moving all of the data into html5 local storage and doing sql selects to build the page sped the entire process up considerably).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM