Reputation: 623
I am having a problem with a web app that I'm working on and I have posted a question here which is a bit vague and probably not very helpful. I have decided to create a really basic site and build it up to be like the main app and see where it breaks. I have done this and got stuck straight away with the offline caching.
This is a basic 3 page static website hosted locally in IIS 7.5. I created the folder c:\inetpub\wwwroot\ManifestTesting, added it to IIS as a web application and added a new MIME type of text/cache-manifest for the .appcache extension. I am also using FireFox 9.0 for testing as this has an offline mode feature.
I created 3 html pages and added them to the ManifestTesting folder:
So now if I browse to http://localhost/manifesttesting if get the index page and can navigate to the 2 pages.
I then created a file called manifest.appcache and added it to the ManifestTesting folder:
CACHE MANIFEST
CACHE:
index.htm
page1.htm
page2.htm
and added the reference to the manifest file in the index.htm:
<html manifest="manifest.appcache">
So if I clear all history and browse to the index.htm, FireFox asks if I want to allow the website to store data for offline use. I click allow, switch the browser to offline mode then attempt to navigate to page1.htm which works fine! So all is good so far.
Now for the bit that I don't understand. I then created a new folder in the ManifestTesting folder called 'pages' and moved page1 and page2 into it. I updated the links in the index to reference the new location and if I browse the website without the manifest reference, it all works fine just as before. I then re-reference the manifest file in the index and update the manifest to be like:
CACHE MANIFEST
CACHE:
index.htm
pages/page1.htm
pages/page2.htm
I then clear history, refresh, firefox asks to allow the website to store offline data, enable offline mode and then attempt to navigate to page1 - it doesn't work! FireFox tells me it's in offline mode and can't browse the web!
What am I doing wrong?
Upvotes: 0
Views: 343
Reputation: 714
There could be a few possibilities here :
1) Can you try putting in "/pages/page1.htm" instead of "pages/page1.htm"
2) also make sure that all the link and what you type on the browser is Case-Sensitive. ('pages/page1.htm' is not the same as 'pages/Page1.htm')
3) you mentioned that you cleared the history... if you're doing it this way for testing, you need to be clearing the physical files cache too, not just the history.
4) this is probably the most likely cause : when you made changes to the manifest file, and you refresh the browser, this is what happens (assuming you're online)
This is currently the standard behaviour. Some people put some event handlers to prompt the user to do another refresh (after the 1st refresh)
Upvotes: 1