Storing web applications locally - new trick!

0 views
Skip to first unread message

Kevin Darling

unread,
Jul 17, 2007, 12:38:53 AM7/17/07
to iPhoneWebDev
I haven't seen this mentioned yet. Somebody came up with a way to
store over 300K (!) worth of app and images inside a bookmark on the
iPhone.

If you read the comments, there's even a bookmarklet that will capture
a screen for you.

http://blog.clawpaws.net/post/2007/07/16/Storing-iPhone-apps-locally-with-data-URLs

dannyg

unread,
Jul 17, 2007, 3:39:13 AM7/17/07
to iPhoneWebDev
Thanks for the pointer. I've made a copy of my Tip Calculator for
iPhone that loads in this fashion, complete with a couple of images
(total data about 31K). You can try it from the second application
link at http://dannyg.com/iphone. It appears, however, that cookies
are not being preserved (the data: protocol probably messes with the
same-origin policy). In all other respects, it's pretty cool.

Danny
http://dannyg.com
http://spamwars.com

Kai Cherry

unread,
Jul 17, 2007, 5:43:03 AM7/17/07
to iphone...@googlegroups.com
Ok...so the $1000 question is...would an IUI app work like this?

Well, I do the crazy stuff so you won't have to...and in a word or
two, the answer looks like "no, not on its current incarnation."

Its pretty interesting what happens, actually. You can grab the data-
fied version of joes demo here as a txt file: http://kaisakura.org/linkv5.txt

You'll want to do that from your desktop machine. Open it up, copy all
and paste into safari 3 address bar and watch what it does.

The phone will do the same, but it will throw an error for you telling
you it can't be loaded. However you can view and save the source as an
HTML dole which will work just great.

Now all of this was not in vain however; check out http://kaisakura.org/app.html

This is joes demo, with the compressed CSS and javascript versions of
iui...with all of the images inlined as data:

This mess believe it or not loads *super fast* over edge...which was
the exact opposite of what I was expecting. Have a look, discuss the
implications and merits, or lack thereof.

Clear your cache, restart your phone from a cold boot and see for
yourself. It seems to defy the 'conventional wisdom' though I suspect
its overall faster because the server is more efficient gziping it
when it is done this way.

*shrug*

I'm taking a nap :)

Sent from my iPhone

Raffaele Sena

unread,
Jul 17, 2007, 9:58:04 AM7/17/07
to iphone...@googlegroups.com
the reason why this version load faster is, I think, because you have reduced the number of requests, and so reduced the number of connections. What is really slow on EDGE is starting a new connection. Some time ago I was playing with a J2ME app that would do some sort of http polling, and requests would get to my server only every 2 seconds (that meant it would take 2 seconds to open a socket connection to my server). So, the less connections you do the better it is. Now if the iPhone would at least do some decent caching (for CSS files and images) and had some support for keep-alive things would be much better, but...

-- Raffaele
Reply all
Reply to author
Forward
0 new messages