Sandra Larsson
Sandra Larsson

Reputation: 31

Problem with HTML5 offline in mobile web app

I can't get offline mode in iphone mobile Safari to work.

I have included my cache manifest file in the root of my directory.

 <html lang="se" manifest="cache.manifest">

My cache.manifest looks like

  CACHE MANIFEST 

  CACHE:
  /images/background-iphonelines.png
  /images/acne.jpg
 /images/lisa.jpg
 /images/bruno.jpg
 /images/urban.jpg
 /shops/acne.html
 /shops/lisa.html
 /shops/bruno.html
 /shops/urban.html
 /shops/shops.css
  /style.css
  script.js
  guide.html

  NETWORK:
  *

I also included a .htaccess file in my root directory with the content

  AddType text/cache-manifest .manifest

When I'm trying to open my app on my Iphone it still says "Can't open page" (or similar, have my page in swedish).

Does someone have any suggestions what I'm doing wrong?

Upvotes: 1

Views: 4133

Answers (4)

user1846030
user1846030

Reputation: 21

I was struggling for 2 hours with this and finally I've managed it! HORAY! I've added "/" to cache, this was the problem...

Upvotes: 0

Abhijeet Ashok Muneshwar
Abhijeet Ashok Muneshwar

Reputation: 2508

I also had the same problem. I included the lines below in the cache.manifest file & it fixed for me.

NETWORK:

*

Upvotes: 0

Chuck Haines
Chuck Haines

Reputation: 692

I actually had a similar issue yesterday. Try removing the CACHE: and just listing the items for the cache. I found this by accident and it seems to now work on IOS for me. Also, I added a comment field at the top to make sure I can invalidate the cache. I would give that a try.

Upvotes: 0

Ben
Ben

Reputation: 7597

Your mark-up and cache file look fine, but if the site won't go off-line there's a problem with the cache. It only has to fail on one element, and the whole thing won't work. Have you tried debugging your cache file? This post will help:

Jonathan Stark, Debugging HTML 5 Offline Application Cache

Note this won't tell you which asset causes the failure (if any), but it will tell you if your cache is working or not.

Upvotes: 1

Related Questions