Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone WebApp cache

I've made a simple Web Application for the iPhone, it's just 6 pages each with an image on it and I use the Cube transition to switch between them, all static content.

I need this to work on an iPod Touch offline, i.e. visit it once, disconnect from WiFi, and then be able to browse the static site.

I'm trying to do this using the HTML5 manifest feature, but I'm clearly doing it wrong?

My Manifest file:

CACHE MANIFEST
index.html
main.css
main.js
Images/Appointments_Page.png
Images/backgroundStripes.png
Images/button.png
Images/button1.png
Images/button1_clicked.png
Images/button2.png
Images/button2_clicked.png
Images/button3.png
Images/button3_clicked.png
Images/button_clicked.png
Images/CloseIcon.png
Images/CloseIcon_pressed.png
Images/Efficacy_Page.png
Images/EfficacyGraph_Page.png
Images/Graph_Icon.png
Images/GraphIcon.png
Images/GraphIcon_pressed.png
Images/Home_Page.png
Images/Tolerability_Page.png
Images/TolerabilityTable_Page.png
Images/WebClipIcon.png
Parts/ButtonHandler.js
Parts/PushButton.js
Parts/setup.js
Parts/StackLayout.js
Parts/Transitions.css
Parts/Transitions.js
Parts/utilities.js

top of my HTML file

<!DOCTYPE HTML>
<html manifest="cache-manifest">
like image 504
Tablet Avatar asked Mar 31 '09 13:03

Tablet


2 Answers

Hey I figured it out, leaving answer here in case it helps anyone else.

The problem I was having was that our server (IIS6) was refusing to serve my manifest file.

I had to add the MIME type ".manifest" using "text/cache-manifest".

Since then it's been caching fine, all 40+ files ranging from 1kb to 200kb.

Hope this helps.

like image 140
Tablet Avatar answered Oct 06 '22 04:10

Tablet


I also wrote some tips on using the Manifest at: http://wecreategames.com/blog/?p=210

Other things to note: You need to reload the app TWICE to get the manifest's new contents, and you need to change the actual content of the manifest to force reloading the containing pages (I do this by changing a comment #v.03 to #v.04, or something similar).

like image 25
JayCrossler Avatar answered Oct 06 '22 05:10

JayCrossler