1

I've been fighting with my site for a good week now trying to get the site accessible offline, and I'm finally admitting defeat. Can anyone see what I've done wrong? Or give me some ideas of what else I should be testing?

My index.html file starts with:

<!DOCTYPE HTML>
<html manifest="cache.manifest">
    <head>

I have a .htaccess.txt file in the same folder that says:

AddType text/cache-manifest .manifest

My cache.manifest file in the same folder says:

CACHE MANIFEST

# version 0.4
# If any of the files you list here isn't available, nothing gets cached.
# The cache limit for Mobile Safari is 10 MB.  Only 5MB for Chrome.

CACHE:
/assets/primary.css
/assets/primary.js
/assets/jquery-1.7.1.min
/assets/content/home.html
/assets/images/background_banner.jpg
/assets/images/background_content.jpg
/assets/images/background_content_home.jpg
/assets/images/icon.png
/assets/images/leaves_banner.png
/assets/images/leaves_nav.png
/assets/images/logo.png
/assets/images/startup_landscape.jpg
/assets/images/startup_portrait.jpg

NETWORK:
*

I've double-checked that I have no typos in the files in my cache file, and the file size is under 10 MB. The cache file is saved using ANSI format.

The site loads fine on my iPad when I'm connected to the internet. But when I turn on Airplane Mode I just get the landscape loading screen (startup_landscape.jpg file pointed at in the index.html file).

I've tried referring to the file as cache.appcache as well (although I have no clue what the difference is). It doesn't seem to resolve the issue anyway.

I'm stuck here. Any ideas would be greatly appreciated.

Update: 25 Oct

I've tried creating a simpler site with a single HTML page, a CSS file and an (empty) .JS file. The index.html file is visible offline, but the .CSS isn't applied; so I presume the cacheing still isn't working properly.

I tried adding an image to the page and not cacheing it. The site still worked in offline mode - it just showed an empty box where the image should be. But if I tried to add the image name to the cache, I can't even get the index.html page to come up in offline mode - I just get a blank white screen.

  • Are you sure all of your assets are in the cache? – SheetJS Oct 24 '13 at 02:50
  • There are some assets I took out. I thought the way it worked was that you could just list some of your assets in the cache. Do I need to list everything on every page? – M Hetherington Oct 24 '13 at 21:23
  • Given that you said the rest come from network, yes you must enumerate all of the static assets – SheetJS Oct 24 '13 at 21:40
  • ? Maybe I'm being dense; but I don't understand. These were the files in sub-folders of the website. I wasn't pointing to any content in another location. I've tested this principle on a simpler website and it worked fine (see more info above) – M Hetherington Oct 24 '13 at 21:56

1 Answers1

1

Try renaming .htaccess.txt to .htaccess?

webinista
  • 3,750
  • 1
  • 20
  • 21
  • I tried to do that, but I got an error saying I needed an actual file name (because .htaccess then became the file extension). Is there some fancy technical way to do this that I don't know about? – M Hetherington Oct 24 '13 at 20:46
  • That's an odd error to get, and it may have to do with your OS. Are you working from a web server? Is it an Apache server? .htaccess is specific to Apache, so you may need to consult your server docs. – webinista Oct 24 '13 at 21:02
  • I've managed to update the .htaccess file through CPanel; but the site still isn't working offline. – M Hetherington Oct 24 '13 at 21:23