Offline iOS web app: loads my manifest, but doesn't work offline

后端 未结 13 2118
温柔的废话
温柔的废话 2020-12-04 05:57

I\'m writing a web app to be used offline on iOS. I\'ve created a manifest, am serving it up as text/cache-manifest, and it usually works fine, when running in

13条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-04 06:29

    I have one potential workaround for this - it seems a bit crazy, but here goes... I work with the cache.manifest and full screen apps a lot (here's a test if you need: http://www.mrspeaker.net/2010/07/12/argy-bargy/ - add to home screen then turn on flight mode and it launches - at least, as of iOS 4.2.1)

    One weird thing I found is that sometimes it seems that some kind of "meta" information in files can mess them up from being cached - Have you ever noticed that in bash that if you do a "ls" some files (depending on your colour settings) are highlighted for no apparent reason? Files can have meta data that the operating system (I think) adds automagically - and there are ways to remove it... I can't remember why but here's some more details: Strip metadata from files in Snow Leopard

    After tearing my hair out one day - and refusing to give up because I knew it SHOULD have worked... Chrome was saying it loaded all the files, but ended with a generic error. In the end I recreated the project structure with blank files and copy/pasted the contents over. It worked - started caching as it was supposed to!

    When I looked at the files I noticed there was some meta info. I tried scrubbing this info and the original project worked again. I'm not sure this was the reason it worked again - perhaps it was just a coincidence.

    Because it worked, I didn't think too much about it. The same problem happened again some months later and the copy/paste trick worked again. I was busy, so I didn't investigate further - but vowed I would get to the bottom of it the next time it happened.... but I haven't had to yet.

    Phew. Anyway, glad I got to write that down somewhere...

    [UPDATE: months and months later - I've not been able to reproduce this, so I don't think it's the metadata]

提交回复
热议问题