> that somtimes it work and somtimes not.

That's what I thought at first. Then, I notice that it is because there are 
significant lag time because the loading is done in a background. 

The listener is not called, if the cache is already updated. So, you need to 
both register and update.

   https://gist.github.com/618005


----------
Thomas Yip              [email protected]
http://beedesk.com
twitter: @BeeDesk


> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Ofir
> Sent: Friday, November 05, 2010 5:01 AM
> To: iPhoneWebDev
> Subject: Re: Offline web application - problem with Safari for iPhone
> 
> Actually we tested the application on desktop chrome and it work great. we
> also notice that if on of the files in the manifest can not be found the 
> entire
> offline feature is not working.
> We also implement the MIME type correctly.
> Another strange thing we saw is that somtimes it work and somtimes not.
> I think the best way to continue is:
> 1.check it on desktop Safari.
> 2.Register to the cache events and Alert them to see if the events flow is
> correct.
> 
> n 4 נובמבר, 23:30, Brian McMillin <[email protected]> wrote:
> > 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
> 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
> > 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.

Reply via email to