I completely agree with Peter's comments.

It is critical that your web server support the cache/manifest MIME type.  One 
of my hosting services didn't know what I was talking about, and I had to point 
out that their conf/mime.types needed to be updated to include

text/cache-manifest    manifest

I have found the cache/manifest feature to be extremely difficult to debug and 
get right.  Different desktop browser implementations use different expiration 
rules.  In some cases, I have found it almost impossible to force an old 
version 
out of the cache so you are sure you are debugging the latest-and-greatest.

Also, at least on iOS 3.x, I have seen working, cached apps spontaneously fail. 
 
Perhaps some event flushed the cache.  Perhaps there is an (undocumented??) 
expiration of cache files.  I never figured it out, but it is truly annoying.  
As soon as it can reload, everything is fine again.

It is also difficult to predict whether every file in the manifest will be 
reloaded, or just ones that have changed.  This has ramifications if some of 
the 
files are big, or if you are supporting 2.5G (EDGE) iPhones.

I would strongly suggest that you do your manifest/online/offline testing with 
one stable version of you App, and do the actual App development without 
messing 
with the cache at all.  You will avoid much frustration if you reduce the 
number 
of independent variables.

Brian




________________________________
From: Peter Rust <[email protected]>
To: [email protected]
Sent: Thu, November 4, 2010 2:51:47 PM
Subject: RE: Offline web application - problem with Safari for iPhone

Have you verified that the cache manifest is being read & all the referenced 
files have been successfully saved when it was last online?

We've found that the various vendors implement offline web apps (cache manifest 
handling) different from each-other when it gets to the details, making it a 
very difficult thing to handle. I strongly recommend getting it functioning 
properly & tested on Safari Desktop before attempting to test on the phone, 
since the desktop is so much easier to debug and develop with.

I also suggest capturing and reporting the various cache manifest events that 
are thrown so you can watch the browser download the files in the manifest and 
verify that it gave a success message at the end.

Safari's Web Inspector is very helpful in this regard. Even if the initial 
download of the app based on the cache manifest is successful, safari will 
throw 
an error if the app requests a file not listed in the manifest or will try to 
access the file through the network *if the URL matches any prefix* in the 
NETWORK section of the manifest.

But from what you're describing, my best guess is that Safari doesn't like the 
manifest itself (is it served with the correct MIME type?) or that Safari had 
trouble downloading all the files referenced in the manifest.

-- peter

-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of Ofir
Sent: Thursday, November 04, 2010 12:31 PM
To: iPhoneWebDev
Subject: Re: Offline web application - problem with Safari for iPhone

The iPhone is not connected to the net but when trying to browse to
the above url the Safari saying somthing like " can't find url"
instead of loading the url from local storage.

On 4 נובמבר, 00:07, Alon Raskin <[email protected]> wrote:
> I am confused. Why does it access the server if it is offline? How is it 
>accessing the server? Is it retrieving a MIME or is it a xmlHTTPRequest?
>
> Alon Raskin
> e: [email protected]
>
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On 
>Behalf Of The Mobile Spoon
> Sent: Wednesday, November 03, 2010 1:57 PM
> To: iPhoneWebDev
> Subject: Offline web application - problem with Safari for iPhone
>
> Hi,
>
> We have developed a web application using JS and Html5 which can run
> completely offline.
>
> We are using a local storage and in addition, the entire forms set is
> loaded in advanced, and only once.
> This means that when opening the URL while offline, the application
> loads the html and the data from the local database.
>
> On Android devices this is working great.
> On the iPhone, on the other hand, sometimes, when opening Safari - it
> tried to access the server, and if the 3G is and Wifi off - it raises
> an error.
>
> My question: how can we block this attempt by Safari - we would like
> to force it to stay offline and use the offline capabilities of our
> applicaiton.
>
> --
> You received this message because you are subscribed to the Google Groups 
>"iPhoneWebDev" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
>[email protected].
> For more options, visit this group 
>athttp://groups.google.com/group/iphonewebdev?hl=en.-הסתר טקסט מצוטט-
>
> -הראה טקסט מצוטט-

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.


      

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.

Reply via email to