PDA

View Full Version : Slow loading of app despite cache.manifest



beetree
9 Sep 2011, 1:17 PM
Hi,

I have a standard "Hello World" app (see bottom for full code) with the following cache.manifest file:



CACHE MANIFEST


# Version 1


index.html
lib/resources/css/apple.css
lib/sencha-touch-debug.js
app.js


NETWORK:
*


I "Add to Home Screen" on my iPhone 4 and then measure the time between when I click the icon of the app and when I see the text "Hello World". I average 4.5 seconds for this which seems very high given that everything is cached.

Question: Is this the best I can do with caching? Should I never expect any Sencha Touch app to load faster than 4.5 seconds?

Do note that I do not have the iPhone in "flight mode" so it does have network access (WLAN with 80 ms latency to server) and needs to check for changes in cache.manifest. But, besides that everything is cached so I don't understand why it takes so long...?

Anyone?

Thanks!





index.html


<!DOCTYPE html>
<html manifest="cache.manifest">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>test</title>


<link href="lib/resources/css/apple.css" rel="stylesheet" type="text/css" />
<script src="lib/sencha-touch-debug.js" type="text/javascript"></script>
<script src="app.js" type="text/javascript"></script>


</head>
<body></body>
</html>


app.js




Ext.setup({
icon: 'icon.png',
onReady: function() {
rootPanel = new Ext.Panel({
fullscreen: true,
items: [startView],
});
}
});




var startView = new Ext.Panel({
fullscreen: true,
html: 'hello world'
});

mrduck
18 Jan 2012, 9:48 AM
It looks like that the manifest file gets ignored when you are using the full-screen (native look) mode. That's one reason why it works slow, especially using a 2G connection.

Did you already find a solution for your problem? I'm interested!